/* Voting App 2.0 — app-specific styles
   Built on tokens from colors_and_type.css */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ui-text-01);
  background: var(--ui-background-02);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ----------------------- App shell ----------------------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ui-background-02);
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--ui-outline-01);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand img { height: 22px; }
.topbar-brand-divider {
  width: 1px;
  height: 22px;
  background: var(--ui-outline-01);
  margin: 0 4px;
}
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ui-text-01);
  letter-spacing: 0.2px;
}
.topbar-title small {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ui-text-02);
  background: var(--ui-greyscale-20);
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.topbar-nav { display: flex; gap: 4px; height: 100%; align-items: center; }
.topbar-nav .nav-item {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ui-text-02);
  cursor: pointer;
  letter-spacing: 0.2px;
  user-select: none;
}
.topbar-nav .nav-item:hover { background: var(--ui-greyscale-10); color: var(--ui-text-01); }
.topbar-nav .nav-item.active {
  background: var(--brand-sea-foam-50);
  color: var(--brand-dark-green-50);
  font-weight: 600;
}
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; gap: 10px; align-items: center; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--ui-outline-01);
  background: #fff;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
}
.user-chip:hover { background: var(--ui-greyscale-10); }

/* ----------------------- Page layout ----------------------- */
.page { padding: 32px 36px 64px; max-width: 1240px; margin: 0 auto; width: 100%; }
.page-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 24px;
}
.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.page-sub {
  font-size: 13.5px;
  color: var(--ui-text-02);
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ui-text-03);
  margin-bottom: 8px;
}

/* ----------------------- Buttons ----------------------- */
.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ui-text-01);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-dark-green-50); border-color: var(--brand-dark-green-50); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ui-state-hover-01); border-color: var(--ui-state-hover-01); }
.btn-ghost { background: #fff; color: var(--brand-dark-green-50); border-color: var(--brand-dark-green-50); }
.btn-ghost:hover { background: var(--brand-sea-foam-10); }
.btn-light { background: #fff; color: var(--ui-text-01); border-color: var(--ui-outline-01); font-weight: 500; }
.btn-light:hover { background: var(--ui-greyscale-10); }
.btn-text { background: transparent; border-color: transparent; color: var(--brand-dark-green-50); }
.btn-text:hover { background: var(--brand-sea-foam-10); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }

/* ----------------------- Card / panel ----------------------- */
.card {
  background: #fff;
  border: 1px solid var(--ui-outline-02);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.card-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ui-outline-02);
}
.card-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.card-sub { font-size: 12px; color: var(--ui-text-02); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 20px; }

/* ----------------------- Avatar ----------------------- */
.av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-moss-blue-50);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.av.lg { width: 36px; height: 36px; font-size: 13px; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid #fff; margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* ----------------------- Score chip / pill ----------------------- */
.score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 26px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--ui-greyscale-20);
  color: var(--ui-text-01);
}
.score-chip.lg { height: 36px; min-width: 36px; font-size: 16px; padding: 0 12px; border-radius: 8px; }

/* ----------------------- Status pills ----------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: var(--ui-greyscale-20);
  color: var(--ui-text-02);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pill.open    { background: var(--brand-sea-foam-50); color: var(--brand-dark-green-50); }
.pill.closed  { background: var(--ui-greyscale-20); color: var(--ui-text-02); }
.pill.won     { background: var(--ui-success-20); color: var(--ui-success-90); }
.pill.pass    { background: var(--ui-greyscale-20); color: var(--ui-text-02); }
.pill.advance { background: var(--brand-sea-foam-50); color: var(--brand-dark-green-50); }
.pill.warn    { background: #fbf5e5; color: var(--brand-gold-100); }
.pill.crit    { background: var(--ui-critical-10); color: var(--ui-critical-90); }
.pill.outline { background: transparent; border: 1px solid var(--ui-outline-01); color: var(--ui-text-02); }
.pill.brand   { background: var(--brand-sea-foam-50); color: var(--brand-dark-green-50); }

/* ----------------------- Inputs ----------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.26px;
  color: var(--ui-text-02);
}
.field input, .field textarea, .field select {
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--ui-outline-01);
  border-radius: 8px;
  background: #fff;
  outline: none;
  color: var(--ui-text-01);
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand-dark-green-50);
  box-shadow: 0 0 0 3px var(--brand-sea-foam-20);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ----------------------- Modal ----------------------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(35, 35, 35, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 8px;
}
.modal-title { font-size: 18px; font-weight: 600; line-height: 1.3; }
.modal-sub { font-size: 13px; color: var(--ui-text-02); margin-top: 4px; }
.modal-body { padding: 14px 24px 8px; }
.modal-actions {
  padding: 16px 24px 22px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--ui-text-02);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ui-greyscale-10); color: var(--ui-text-01); }

/* ----------------------- Toast ----------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-dark-green-100);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease-out;
}
.toast .ok { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-aloe-green-50); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat {
  background: #fff;
  border: 1px solid var(--ui-outline-02);
  border-radius: 12px;
  padding: 18px 18px 16px;
}
.stat-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ui-text-02);
}
.stat-val {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 8px;
}
.stat-sub { font-size: 12px; color: var(--ui-text-02); margin-top: 2px; }

.dash-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  border: 1px solid var(--ui-outline-01);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}
.search-input input { border: none; outline: none; flex: 1; font-size: 14px; background: transparent; }
.search-input svg { opacity: 0.5; flex-shrink: 0; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--ui-greyscale-10);
  padding: 4px;
  border-radius: 10px;
}
.tabs .tab {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ui-text-02);
  cursor: pointer;
  user-select: none;
}
.tabs .tab.active { background: #fff; color: var(--ui-text-01); box-shadow: 0 1px 2px rgba(35,35,35,0.06); }
.tabs .tab .count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--ui-text-03);
  font-weight: 500;
}
.tabs .tab.active .count { color: var(--brand-dark-green-50); }

/* Deal card */
.deal-grid { display: flex; flex-direction: column; gap: 10px; }
.deal-row {
  background: #fff;
  border: 1px solid var(--ui-outline-02);
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 56px 1.6fr 1fr 1.2fr 1.4fr 110px;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.deal-row:hover { border-color: var(--brand-dark-green-30); box-shadow: var(--shadow-md); }
.deal-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-dark-green-50);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  letter-spacing: 0.5px;
}
.deal-mark.b { background: var(--brand-moss-blue-100); }
.deal-mark.c { background: var(--brand-gold-90); }
.deal-mark.d { background: var(--brand-aloe-green-100); }
.deal-mark.e { background: var(--brand-dark-green-100); }
.deal-mark.f { background: var(--brand-moss-blue-50); }
.deal-name { font-size: 15px; font-weight: 600; color: var(--ui-text-01); }
.deal-meta { font-size: 12px; color: var(--ui-text-02); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.deal-meta span:not(.pill) { white-space: nowrap; }
.deal-meta span:not(:first-child):not(.pill)::before { content: "·"; margin-right: 6px; opacity: 0.5; }
.deal-team { display: flex; align-items: center; gap: 8px; }
.deal-team-label { font-size: 11px; color: var(--ui-text-03); font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.deal-progress { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.deal-progress-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.deal-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--ui-greyscale-20);
  border-radius: 999px;
  overflow: hidden;
}
.deal-progress-bar > span { display: block; height: 100%; background: var(--brand-dark-green-50); border-radius: 999px; }
.deal-progress-meta { font-size: 11.5px; color: var(--ui-text-02); }
.deal-progress-meta b { color: var(--ui-text-01); font-weight: 600; }
.deal-cta { display: flex; justify-content: flex-end; }

/* ============================================================
   VOTE CASTING
   ============================================================ */
.vote-cast-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: flex-start;
}
.vote-deal-summary {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--brand-dark-green-100), var(--brand-dark-green-50));
  color: #fff;
  border-radius: 14px;
  margin-bottom: 18px;
}
.vote-deal-summary .stage-line {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  opacity: 0.8;
}
.vote-deal-summary h2 {
  font-size: 26px;
  font-weight: 600;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}
.vote-deal-summary .desc { font-size: 13.5px; line-height: 1.5; opacity: 0.9; }
.vote-deal-summary .terms { display: flex; gap: 24px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.18); }
.vote-deal-summary .term { font-size: 12px; }
.vote-deal-summary .term .l { font-size: 10.5px; opacity: 0.7; letter-spacing: 0.6px; text-transform: uppercase; font-weight: 600; }
.vote-deal-summary .term .v { font-size: 14px; font-weight: 600; margin-top: 2px; }

.scale-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.scale-btn {
  height: 70px;
  border: 1px solid var(--ui-outline-01);
  background: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s, background 0.1s;
  padding: 0 4px;
}
.scale-btn .num {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.scale-btn .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--ui-text-02);
  text-align: center;
  line-height: 1.1;
}
.scale-btn:hover { border-color: var(--brand-dark-green-50); transform: translateY(-1px); }
.scale-btn.tone-crit    { color: var(--ui-critical-90); }
.scale-btn.tone-warn    { color: var(--brand-gold-100); }
.scale-btn.tone-neutral { color: var(--ui-text-01); }
.scale-btn.tone-ok      { color: var(--brand-dark-green-50); }
.scale-btn.tone-great   { color: var(--brand-dark-green-100); }
.scale-btn.selected {
  background: var(--brand-dark-green-50);
  border-color: var(--brand-dark-green-50);
  color: #fff !important;
}
.scale-btn.selected .lbl { color: rgba(255,255,255,0.8); }
.scale-rubric {
  margin-top: 4px;
  background: var(--brand-sea-foam-10);
  border: 1px solid var(--brand-sea-foam-50);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--brand-dark-green-100);
}
.scale-rubric .num {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--brand-dark-green-50);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.scale-rubric .l { font-weight: 700; }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ui-outline-01);
  background: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ui-text-02);
  cursor: pointer;
}
.tag-chip:hover { border-color: var(--brand-dark-green-50); color: var(--ui-text-01); }
.tag-chip.selected { background: var(--brand-sea-foam-50); border-color: var(--brand-dark-green-50); color: var(--brand-dark-green-50); }

.vote-side-card { padding: 18px 20px; }
.vote-side-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ui-text-01);
}
.vote-side-card .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12.5px; }
.vote-side-card .row:not(:last-child) { border-bottom: 1px solid var(--ui-outline-02); }
.vote-side-card .row .l { color: var(--ui-text-02); }
.vote-side-card .row .v { font-weight: 600; }

/* ============================================================
   RESULTS / DEAL DETAIL
   ============================================================ */
.results-hero {
  background: #fff;
  border: 1px solid var(--ui-outline-02);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 18px;
}
.results-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}
.results-hero h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.results-hero .meta { font-size: 13px; color: var(--ui-text-02); }
.results-hero .terms { display: flex; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ui-outline-02); }
.results-hero .term .l { font-size: 10.5px; color: var(--ui-text-03); letter-spacing: 0.5px; text-transform: uppercase; font-weight: 600; }
.results-hero .term .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.headline-stats { display: flex; gap: 28px; margin-top: 6px; }
.headline-stat .l { font-size: 10.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ui-text-03); font-weight: 600; }
.headline-stat .v { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.headline-stat.big .v { font-size: 40px; }

/* Histogram */
.histogram {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  align-items: end;
  height: 200px;
  padding: 0 4px;
}
.histo-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.histo-bar .stack { width: 100%; display: flex; flex-direction: column-reverse; gap: 2px; flex: 1; justify-content: flex-end; }
.histo-bar .pip {
  width: 100%;
  height: 16px;
  border-radius: 4px;
  background: var(--brand-dark-green-50);
}
.histo-bar .pip.team { background: var(--brand-aloe-green-50); }
.histo-bar .num {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-text-02);
  font-variant-numeric: tabular-nums;
}
.histo-bar .lbl {
  font-size: 9.5px;
  text-align: center;
  color: var(--ui-text-03);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.1;
}
.histogram-x {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px;
}
.histogram-x > div { text-align: center; font-size: 11px; color: var(--ui-text-02); font-weight: 600; }

.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ui-text-02); align-items: center; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: middle; }

/* Voter list */
.voters-grid {
  display: flex;
  flex-direction: column;
}
.voter-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ui-outline-02);
  align-items: center;
}
.voter-row:last-child { border-bottom: none; }
.voter-row .who { font-size: 13.5px; font-weight: 600; }
.voter-row .role { font-size: 11.5px; color: var(--ui-text-03); }
.voter-row .comment { font-size: 12.5px; color: var(--ui-text-02); margin-top: 4px; line-height: 1.45; }
.voter-row .tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: var(--brand-moss-blue-10);
  color: var(--brand-moss-blue-100);
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.voter-row.team-member { background: var(--brand-sea-foam-5); }
.voter-row.no-vote .who { color: var(--ui-text-03); }

/* AI summary card */
.ai-card {
  background: linear-gradient(135deg, #fff, var(--brand-sea-foam-5));
  border: 1px solid var(--brand-sea-foam-50);
  border-radius: 14px;
  padding: 22px 24px;
}
.ai-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--brand-dark-green-100);
  margin: 0 0 14px;
}
.ai-card h3 .badge {
  font-size: 10px;
  letter-spacing: 0.4px;
  background: var(--brand-dark-green-100);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.ai-themes { display: flex; flex-direction: column; gap: 12px; }
.ai-theme {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--brand-sea-foam-50);
}
.ai-theme:first-child { border-top: none; padding-top: 4px; }
.ai-theme .icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  margin-top: 2px;
}
.ai-theme.positive .icon { background: var(--brand-aloe-green-50); color: var(--brand-dark-green-100); }
.ai-theme.concern .icon { background: var(--brand-gold-30); color: var(--brand-gold-100); }
.ai-theme .theme-title { font-size: 14px; font-weight: 600; color: var(--ui-text-01); }
.ai-theme .theme-quote { font-size: 13px; font-style: italic; color: var(--ui-text-02); margin-top: 3px; line-height: 1.5; }
.ai-theme .theme-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-text-02);
  background: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--ui-outline-01);
  white-space: nowrap;
}

/* Round comparison */
.round-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.round-tab {
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--ui-outline-01);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.round-tab.active {
  border-color: var(--brand-dark-green-50);
  background: var(--brand-sea-foam-10);
  color: var(--brand-dark-green-50);
}
.round-tab .step {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ui-greyscale-30);
  color: var(--ui-text-02);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.round-tab.active .step { background: var(--brand-dark-green-50); color: #fff; }

/* Vote shift visual */
.shift-list { display: flex; flex-direction: column; gap: 6px; }
.shift-row {
  display: grid;
  grid-template-columns: 28px 1fr 50px 60px 50px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.shift-row:hover { background: var(--ui-greyscale-10); }
.shift-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--ui-greyscale-20);
  color: var(--ui-text-02);
  font-variant-numeric: tabular-nums;
}
.shift-arrow.up { background: var(--brand-aloe-green-30); color: var(--brand-dark-green-100); }
.shift-arrow.dn { background: var(--ui-critical-10); color: var(--ui-critical-90); }
.shift-arrow.same { background: var(--ui-greyscale-20); color: var(--ui-text-02); }

/* ============================================================
   ANALYTICS
   ============================================================ */
.analytics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.analytics-grid > .full { grid-column: 1 / -1; }
.analytics-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.analytics-stat .v {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.analytics-stat .delta {
  font-size: 13px;
  font-weight: 600;
}
.analytics-stat .delta.up { color: var(--brand-dark-green-50); }
.analytics-stat .delta.dn { color: var(--ui-critical-70); }

/* Bias matrix */
.bias-matrix {
  display: grid;
  grid-template-columns: 110px repeat(5, 1fr);
  gap: 4px;
}
.bias-matrix .hd {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ui-text-03);
  text-align: center;
  padding: 6px 4px;
}
.bias-matrix .row-label {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  padding: 0 8px;
}
.bias-cell {
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Calibration plot */
.calib-plot {
  position: relative;
  height: 240px;
  background: linear-gradient(90deg, #fff, var(--brand-sea-foam-5));
  border: 1px solid var(--ui-outline-02);
  border-radius: 10px;
  padding: 14px 18px 28px 40px;
}
.calib-axis-y, .calib-axis-x {
  position: absolute;
  font-size: 10px;
  color: var(--ui-text-03);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.calib-axis-y { left: 8px; top: 50%; transform: rotate(-90deg) translateY(-50%); transform-origin: left top; }
.calib-axis-x { bottom: 4px; left: 50%; transform: translateX(-50%); }
.calib-grid {
  position: absolute;
  inset: 14px 18px 28px 40px;
  border-bottom: 1px solid var(--ui-outline-02);
  border-left: 1px solid var(--ui-outline-02);
}
.calib-grid::before, .calib-grid::after {
  content: "";
  position: absolute;
  border-style: dashed;
  border-color: var(--ui-outline-02);
}
.calib-grid::before { left: 0; right: 0; top: 50%; border-top-width: 1px; }
.calib-grid::after { top: 0; bottom: 0; left: 50%; border-left-width: 1px; }
.calib-dot {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translate(-50%, 50%);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.calib-dot.win   { background: var(--brand-aloe-green-50); }
.calib-dot.miss  { background: var(--ui-critical-50); }
.calib-dot.good  { background: var(--brand-dark-green-50); }
.calib-dot.neutral { background: var(--brand-moss-blue-50); }
.calib-quadrant {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ui-text-03);
  padding: 4px 8px;
}

/* Peer comparison */
.peer-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--ui-outline-02);
}
.peer-row:last-child { border-bottom: none; }
.peer-row .who { font-weight: 600; }
.peer-row .who.me { color: var(--brand-dark-green-50); }
.peer-track {
  position: relative;
  height: 8px;
  background: var(--ui-greyscale-20);
  border-radius: 999px;
}
.peer-fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--brand-dark-green-50);
  border-radius: 999px;
  left: 0;
}
.peer-row.me .peer-fill { background: var(--brand-aloe-green-50); }
.peer-row .num { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* Sparkline */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
}
.spark .bar {
  flex: 1;
  background: var(--brand-dark-green-50);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

/* Vote-row table for history */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.history-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ui-text-03);
  background: var(--ui-greyscale-5);
  border-bottom: 1px solid var(--ui-outline-02);
}
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ui-outline-02);
}
.history-table tr:hover td { background: var(--brand-sea-foam-5); }
.history-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.history-table .deal-cell { font-weight: 600; }
.history-table .deal-sub { font-size: 11px; color: var(--ui-text-03); margin-top: 2px; font-weight: 500; }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--ui-outline-02); margin: 18px 0; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ui-text-02);
  font-size: 13px;
}

.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--ui-greyscale-10);
  border: 1px solid var(--ui-outline-01);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ui-text-02);
}

/* Cool conviction-meter for cast vote */
.conviction-meter {
  position: relative;
  height: 56px;
  background: linear-gradient(90deg,
    var(--ui-critical-30) 0%,
    var(--ui-critical-30) 12.5%,
    var(--brand-gold-30) 12.5%,
    var(--brand-gold-30) 37.5%,
    var(--brand-sea-foam-50) 37.5%,
    var(--brand-sea-foam-50) 75%,
    var(--brand-aloe-green-50) 75%,
    var(--brand-aloe-green-50) 100%);
  border-radius: 10px;
  margin-top: 4px;
  overflow: hidden;
}
.conviction-marker {
  position: absolute;
  top: -8px;
  width: 4px;
  height: 72px;
  background: var(--brand-dark-green-100);
  border-radius: 2px;
  transition: left 0.2s ease-out;
}
.conviction-marker::after {
  content: attr(data-v);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-dark-green-100);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
