/* Voting Survey — EVM Ballot Unit & Real-Time Result Graphs */

.evm-page {
  padding: 26px 0 64px;
}

.evm-selector-card {
  background: #ffffff;
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(12, 37, 74, 0.06);
  margin-bottom: 22px;
}

.evm-selector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.evm-selector-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b4ea2;
}

.evm-ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 12px;
  font-weight: 700;
}

.evm-led-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
  display: inline-block;
}

.evm-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.evm-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #263f63;
  margin-bottom: 6px;
}

.evm-select {
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid #c5d4e8;
  background: #f8fbff;
  color: #0d2240;
  font-size: 14.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.evm-select:focus {
  border-color: #0b4ea2;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(11, 78, 162, 0.14);
}

.evm-selector-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.evm-seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 10px;
  background: #eff5ff;
  border: 1px solid #cddff8;
  color: #0b3c7c;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Main two-column layout: Left = EVM Machine, Right = Results & Graph */
.evm-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 22px;
  align-items: start;
}

/* Physical EVM Ballot Unit Chassis */
.evm-unit {
  background: linear-gradient(180deg, #f3f6fb 0%, #e7edf6 100%);
  border: 2px solid #b8c7dc;
  border-radius: 18px;
  padding: 16px;
  box-shadow:
    0 14px 34px rgba(11, 31, 61, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.evm-unit-topbar {
  background: linear-gradient(135deg, #0d264a 0%, #153b73 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.evm-unit-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.evm-unit-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #cbe0ff;
}

.evm-unit-counter {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 6px 12px;
}

.evm-unit-counter-val {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.evm-unit-counter-lbl {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #dbeafe;
}

/* White inner ballot sheet */
.evm-ballot-sheet {
  background: #ffffff;
  border: 1px solid #cbd6e6;
  border-radius: 12px;
  overflow: hidden;
}

.evm-ballot-colhead {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 82px 122px;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  background: #f5f8fc;
  border-bottom: 1px solid #dce5f2;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4f6789;
}

.evm-ballot-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 82px 122px;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid #e6edf7;
  transition: background-color 0.15s ease;
}

.evm-ballot-row:last-child {
  border-bottom: 0;
}

.evm-ballot-row:hover {
  background: #f9fbff;
}

.evm-ballot-row.is-voted {
  background: #fff6f5;
}

.evm-serial {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef3fb;
  border: 1px solid #d5e1f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #163766;
}

.evm-cand-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.evm-cand-photo-wrap {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  border: 1.5px solid #cbd7ea;
  background: #f2f6fc;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(13, 38, 74, 0.08);
}

.evm-cand-photo-wrap.sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.evm-cand-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.evm-cand-initials {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.evm-cand-photo-wrap.sm .evm-cand-initials {
  font-size: 11.5px;
}

.evm-cand-info {
  min-width: 0;
  flex: 1;
}

.evm-cand-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.evm-cand-name {
  font-size: 15px;
  font-weight: 750;
  color: #0e2444;
  line-height: 1.25;
}

.evm-party-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}

.evm-party-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.evm-cand-sub {
  margin-top: 3px;
  font-size: 12px;
  color: #5b708f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evm-cand-minibar {
  margin-top: 6px;
  height: 5px;
  border-radius: 99px;
  background: #edf2f8;
  overflow: hidden;
}

.evm-cand-minibar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}

.evm-count-cell {
  text-align: right;
}

.evm-count-num {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0e2444;
  line-height: 1.1;
}

.evm-count-pct {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #526a8b;
  margin-top: 2px;
}

.evm-action-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.evm-vote-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 1.5px solid #94a3b8;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.evm-vote-led.lit {
  background: #ef4444;
  border-color: #b91c1c;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}

.evm-vote-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-width: 92px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1a66d1 0%, #0b4ea2 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 3px 0 #07326c,
    0 6px 14px rgba(11, 78, 162, 0.28);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s ease;
}

.evm-vote-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2172e4 0%, #0e58b8 100%);
}

.evm-vote-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #07326c,
    0 2px 6px rgba(11, 78, 162, 0.25);
}

.evm-vote-btn:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.evm-vote-btn.voted {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 2px 0 #14532d;
  opacity: 1;
}

/* VVPAT Verification Slip */
.evm-vvpat {
  margin-top: 14px;
  background: #fffef5;
  border: 1.5px dashed #d97706;
  border-radius: 12px;
  padding: 12px 15px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evm-vvpat-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.evm-vvpat-detail {
  font-size: 13.5px;
  color: #1f2937;
  font-weight: 600;
  margin-top: 2px;
}

.evm-error-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.evm-empty-ballot {
  padding: 28px 18px;
  text-align: center;
  color: #4f6789;
}

.evm-empty-ballot h4 {
  margin: 0 0 6px;
  color: #122d54;
  font-size: 16px;
}

.evm-empty-ballot p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Results & Live Graphs Column */
.evm-results-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.evm-card {
  background: #ffffff;
  border: 1px solid #d7e2f0;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 22px rgba(12, 37, 74, 0.05);
}

.evm-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.evm-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0e2444;
}

.evm-card-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #5a6f8e;
}

.evm-stat-pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: #f0f6ff;
  border: 1px solid #d3e2f7;
  color: #0b4ea2;
  font-size: 12px;
  font-weight: 800;
}

/* Vertical Column Chart */
.evm-column-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 190px;
  padding: 18px 10px 8px;
  background: #f8fbff;
  border: 1px solid #e3ecf7;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.evm-col-item {
  flex: 1 1 82px;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.evm-col-val {
  font-size: 12px;
  font-weight: 800;
  color: #0e2444;
  margin-bottom: 6px;
}

.evm-col-track {
  width: 38px;
  height: 112px;
  border-radius: 8px 8px 4px 4px;
  background: #e6eef8;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.evm-col-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.35s ease;
  min-height: 4px;
}

.evm-col-name {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #1b365d;
  line-height: 1.25;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evm-col-party {
  font-size: 10.5px;
  font-weight: 700;
  color: #5b708f;
  margin-top: 2px;
}

/* Horizontal Progress Bars */
.evm-bars-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evm-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.evm-bar-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.evm-bar-label {
  font-weight: 700;
  color: #132c51;
}

.evm-bar-nums {
  font-weight: 800;
  color: #0e2444;
  white-space: nowrap;
}

.evm-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #edf2f8;
  overflow: hidden;
}

.evm-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Statewide Summary Grid */
.evm-state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.evm-leader-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.evm-leader-table th,
.evm-leader-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #eaf0f8;
}

.evm-leader-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6f8e;
  font-weight: 800;
}

.evm-jump-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #0b4ea2;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}

.evm-jump-btn:hover {
  text-decoration: underline;
}

.evm-voted-banner {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf9 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.08);
}

.evm-voted-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.evm-voted-banner-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #047857;
}

.evm-voted-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: #064e3b;
  margin-top: 2px;
}

.evm-voted-banner-sub {
  font-size: 12.5px;
  color: #065f46;
  margin-top: 2px;
}

.evm-voted-banner-btn {
  appearance: none;
  border: 1px solid #059669;
  background: #ffffff;
  color: #047857;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.evm-voted-banner-btn:hover {
  background: #059669;
  color: #ffffff;
}

@media (max-width: 980px) {
  .evm-workspace,
  .evm-state-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .evm-selector-grid {
    grid-template-columns: 1fr;
  }

  .evm-ballot-colhead {
    display: none;
  }

  .evm-ballot-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .evm-count-cell {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding-top: 4px;
  }

  .evm-action-cell {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .evm-vote-btn {
    flex: 1;
  }

  .evm-leader-table th,
  .evm-leader-table td {
    font-size: 12px;
    padding: 7px 4px;
    word-break: break-word;
  }
}
