@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600;700;800&family=Poppins:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e9e7e1;
  font-family: 'Poppins', system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 28px 16px;
}

a { color: #162b65; }
a:hover { color: #0e1c45; }

@keyframes vgfade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

#vg-root {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(22, 43, 101, .18);
  display: flex;
  flex-direction: column;
}

.vg-step { animation: vgfade .25s ease; }

/* header */
.vg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eceaf1;
}
.vg-header-brand { display: flex; align-items: center; gap: 10px; }
.vg-mark { width: 30px; height: 30px; background: url('assets/mcdp-mark.png') center/contain no-repeat; }
.vg-app-title { font-family: 'Epilogue'; font-weight: 700; font-size: 16px; color: #162b65; line-height: 1; }

.vg-lang-toggle {
  display: flex;
  border: 1.5px solid #d7d5e0;
  border-radius: 20px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
}
.vg-lang-btn { padding: 5px 11px; cursor: pointer; color: #8b8896; }
.vg-lang-btn.active { background: #DF1930; color: #fff; }

/* step bar */
.vg-stepbar { display: flex; align-items: center; gap: 6px; padding: 14px 18px 4px; }
.vg-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid #d7d5e0; background: #fff; color: #b9b6c4;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: none;
}
.vg-dot.done { border-color: #DF1930; background: #fdecee; color: #DF1930; }
.vg-dot.on { border-color: #DF1930; background: #DF1930; color: #fff; }
.vg-connector { flex: 1; height: 1.5px; background: #e0dee8; }
.vg-connector.done { background: #DF1930; }
.vg-stepof { padding: 0 18px; font-size: 11px; color: #8b8896; letter-spacing: .3px; }

/* body */
.vg-body { padding: 18px; }

/* step 1 */
.vg-h1 { font-family: 'Epilogue'; font-weight: 800; font-size: 27px; line-height: 1.12; color: #162b65; margin: 6px 0 10px; }
.vg-sub1 { font-size: 14px; line-height: 1.5; color: #5f5c6b; margin-bottom: 20px; }
.vg-input {
  width: 100%; border: 1.5px solid #d7d5e0; border-radius: 11px;
  padding: 13px 14px; font-size: 14px; font-family: inherit;
  margin-bottom: 10px; outline: none; color: #1a1a2e;
}
.vg-input:focus { border-color: #162b65; }
.vg-row { display: flex; gap: 10px; margin-bottom: 10px; }
.vg-row .vg-input { margin-bottom: 0; }
.vg-row .vg-input-city { flex: 1; min-width: 0; }
.vg-row .vg-input-zip { width: 104px; }

.vg-submit {
  border-radius: 12px; padding: 14px; text-align: center;
  font-size: 15px; font-weight: 600; transition: .15s;
  background: #DF1930; color: #fff; cursor: pointer; border: none; width: 100%; font-family: inherit;
}
.vg-submit:disabled { background: #c9c6d4; color: #fff; cursor: not-allowed; }
.vg-demo {
  border-radius: 12px; padding: 10px; text-align: center; margin-top: 8px;
  font-size: 13px; font-weight: 500; background: none; border: 1.5px dashed #d7d5e0;
  color: #8b8896; cursor: pointer; width: 100%; font-family: inherit;
}
.vg-demo:hover { border-color: #b9b6c4; color: #6a6776; }
.vg-privacy { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 11.5px; line-height: 1.45; color: #8b8896; }
.vg-privacy .lock { flex: none; }
.vg-error { border: 1.5px solid #f3b8be; background: #fdecee; color: #a8112a; border-radius: 11px; padding: 11px 14px; font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.vg-coverage-warning { border: 1.5px solid #f0d99a; background: #fdf6e3; color: #7a5f00; border-radius: 11px; padding: 10px 14px; font-size: 12.5px; line-height: 1.4; margin-bottom: 12px; }

/* step 2 */
.vg-chips { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.vg-chip { background: #eef1f8; color: #162b65; font-size: 12px; font-weight: 500; border-radius: 16px; padding: 5px 11px; }
.vg-change { border: 1.5px solid #d7d5e0; color: #6a6776; font-size: 12px; border-radius: 16px; padding: 4px 11px; cursor: pointer; background: none; font-family: inherit; }
.vg-cands-heading { font-family: 'Epilogue'; font-weight: 600; font-size: 12px; letter-spacing: .5px; color: #162b65; text-transform: uppercase; margin-bottom: 12px; }

.vg-loading, .vg-empty { text-align: center; padding: 30px 10px; color: #5f5c6b; font-size: 14px; }

.vg-card { border: 1.5px solid #e6e4ee; border-radius: 16px; padding: 13px; margin-bottom: 12px; }
.vg-card-top { display: flex; gap: 12px; }
.vg-photo {
  width: 56px; height: 56px; border-radius: 50%; background: #dcdae4 center/cover no-repeat;
  flex: none; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #948fa6;
}
.vg-card-body { flex: 1; min-width: 0; }
.vg-office { font-size: 11px; letter-spacing: .4px; color: #8b8896; text-transform: uppercase; }
.vg-name-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 2px; }
.vg-name { font-family: 'Epilogue'; font-weight: 600; font-size: 17px; color: #1a1a2e; }
.vg-incumbent { border: 1.3px solid #c9c6d4; color: #7a7786; font-size: 10px; border-radius: 5px; padding: 2px 7px; flex: none; }
.vg-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.vg-badge-dem { background: #162b65; color: #fff; font-size: 11px; border-radius: 5px; padding: 3px 8px 3px 5px; display: inline-flex; align-items: center; gap: 5px; }
.vg-badge-dem .star { width: 12px; height: 12px; background: url('assets/star-white.png') center/contain no-repeat; }

.vg-r2b-wrap { position: relative; display: inline-flex; }
.vg-r2b {
  background: linear-gradient(90deg, #DE1A31, #162b65); color: #fff; font-size: 11px; border-radius: 5px;
  padding: 3px 9px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.vg-r2b .q {
  width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.75);
  display: inline-flex; align-items: center; justify-content: center; font-size: 8px;
}
.vg-r2b-tip {
  visibility: hidden; opacity: 0; transition: opacity .12s;
  position: absolute; bottom: calc(100% + 9px); left: 0; width: 216px;
  background: #162b65; color: #fff; border-radius: 9px; padding: 10px 12px;
  font-size: 11px; line-height: 1.45; box-shadow: 0 8px 22px rgba(0,0,0,.28); z-index: 10;
}
.vg-r2b-tip.open { visibility: visible; opacity: 1; }
.vg-r2b-tip b { display: block; margin-bottom: 4px; color: #fff; font-size: 11px; }
.vg-r2b-tip .arrow { position: absolute; top: 100%; left: 18px; border: 6px solid transparent; border-top-color: #162b65; }

.vg-card-actions { display: flex; gap: 9px; margin-top: 12px; }
.vg-btn-website {
  flex: 1; border-radius: 10px; padding: 9px; text-align: center; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; display: block;
  border: 1.5px solid #162b65; color: #162b65 !important; background: #fff;
}

.vg-measure { border: 1.5px solid #d5d9e8; background: #f6f8fd; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.vg-measure-eyebrow { font-size: 11px; letter-spacing: .5px; color: #162b65; font-weight: 600; text-transform: uppercase; }
.vg-measure-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin: 4px 0 6px; }
.vg-measure-name { font-family: 'Epilogue'; font-weight: 600; font-size: 17px; color: #1a1a2e; }
.vg-measure-rec { background: #162b65; color: #fff; font-size: 11px; border-radius: 5px; padding: 3px 8px 3px 5px; display: inline-flex; align-items: center; gap: 5px; flex: none; }
.vg-measure-rec .star { width: 12px; height: 12px; background: url('assets/star-white.png') center/contain no-repeat; }
.vg-measure-desc { font-size: 12.5px; line-height: 1.45; color: #5f5c6b; }
.vg-measure-link {
  border: 1.5px solid #162b65; color: #162b65; border-radius: 10px; padding: 8px; text-align: center;
  font-size: 12.5px; font-weight: 500; margin-top: 11px; max-width: 200px; cursor: pointer;
  text-decoration: none; display: block;
}

.vg-continue { background: #DF1930; color: #fff; border-radius: 12px; padding: 14px; text-align: center; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px; border: none; width: 100%; font-family: inherit; }

/* step 3 */
.vg-ready-h { font-family: 'Epilogue'; font-weight: 800; font-size: 25px; line-height: 1.15; color: #162b65; margin: 4px 0 6px; }
.vg-ready-sub { font-size: 14px; color: #5f5c6b; margin-bottom: 16px; }
.vg-summary { border: 1.5px solid #e6e4ee; border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.vg-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-bottom: 1px dashed #e6e4ee; }
.vg-summary-row:last-child { border-bottom: none; }
.vg-summary-office { font-size: 12px; color: #8b8896; }
.vg-summary-pick { display: flex; align-items: center; gap: 7px; font-size: 14px; color: #1a1a2e; font-weight: 500; }
.vg-summary-pick .star { width: 14px; height: 14px; background: url('assets/star-navy.png') center/contain no-repeat; }

.vg-screenshot { border: 1.5px dashed #b7bfda; background: #f6f8fd; border-radius: 12px; padding: 14px; margin-bottom: 12px; display: flex; gap: 11px; align-items: center; }
.vg-screenshot .icon { font-size: 20px; flex: none; }
.vg-screenshot .txt { font-size: 13px; line-height: 1.45; color: #4a4857; }

.vg-wherevote {
  border: 1.5px solid #162b65; color: #162b65 !important; border-radius: 12px; padding: 13px; text-align: center;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-bottom: 10px; text-decoration: none; display: block;
}
.vg-startover { text-align: center; font-size: 13px; color: #8b8896; cursor: pointer; background: none; border: none; font-family: inherit; width: 100%; }

@media (max-width: 460px) {
  body { padding: 0; }
  #vg-root { max-width: 100%; border-radius: 0; box-shadow: none; }
}

/* desktop: lay the candidate/measure list out in ballot-style columns
   instead of stretching one narrow mobile card across the whole screen.
   Scoped to #vg-root.vg-wide (set in JS only while the list is actually
   showing -- see render()) so steps 1/3 and the loading/error/empty states
   in step 2 keep the original compact card layout untouched. */
@media (min-width: 971px) {
  #vg-root.vg-wide { max-width: 1040px; }
  .vg-cand-list { column-count: 3; column-gap: 20px; }
  .vg-cand-list .vg-card,
  .vg-cand-list .vg-measure { break-inside: avoid; -webkit-column-break-inside: avoid; }
  .vg-wide .vg-continue { max-width: 340px; margin: 4px auto 0; }
}
