/* My Ballot + email verification / settings */

/* ---------- My Ballot ---------- */
.ballot-page { max-width: 980px; }
.page-head.left { justify-content: flex-start; }
.panel-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.ballot-form { display: grid; gap: 10px; margin-bottom: 18px; }
.ballot-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ballot-input-row input {
  flex: 1 1 240px; min-width: 0; min-height: 50px; padding: 10px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.ballot-input-row .btn { min-height: 50px; padding: 0 18px; font-size: 15px; flex: 0 0 auto; }
@media (max-width: 480px) { .ballot-input-row .btn { flex: 1 1 100%; justify-content: center; } }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 14px; min-height: 44px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: none; }
.ballot-empty { padding: 4px 2px 20px; }

.ballot-head {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px;
  border-left: 5px solid var(--center);
}
.ballot-where { font: 800 18px/1.2 var(--display); word-break: break-word; }
.ballot-districts { font: 600 13px var(--mono); color: var(--ink-2); margin-top: 4px; }
.ballot-head-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 13px; }

.ballot-group { margin-bottom: 22px; }
.ballot-group h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.ballot-group .lvl { font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.ballot-group h2 small { font: 500 13px var(--body); }
.ballot-grid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ballot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ballot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ballot-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
  display: grid; gap: 10px; align-content: start; border-top: 4px solid var(--c, var(--line)); min-width: 0;
}
.ballot-card[data-b="left"] { --c: var(--left); }
.ballot-card[data-b="center"] { --c: var(--center); }
.ballot-card[data-b="right"] { --c: var(--right); }
.ballot-main { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; text-decoration: none; align-items: start; }
.ballot-main:hover .ballot-name { text-decoration: underline; text-underline-offset: 3px; }
.ballot-photo { position: relative; width: 60px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font: 800 18px var(--display); color: var(--ink-2); }
.ballot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ballot-name { font: 700 17px/1.2 var(--display); }
.ballot-office { font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.ballot-meta { margin-bottom: 6px; }
.ballot-info .meter { margin-top: 8px; }
.meter-labels.small { font-size: 10px; margin-top: 4px; }
.ballot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ballot-actions:empty { display: none; }
.ballot-actions .btn { flex: 1 1 0; justify-content: center; min-height: 44px; }
.ballot-link { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ballot-local { display: grid; gap: 8px; margin-bottom: 8px; }
.local-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 14px; }
.local-row small { display: block; font-size: 12px; }
.local-row b { font-family: var(--display); font-size: 16px; }
.ballot-credit { margin-top: 6px; }

/* News rail card */
.ballot-rail.cta { display: grid; gap: 4px; text-decoration: none; border: 2px dashed var(--line); }
.ballot-rail.cta:hover { border-color: var(--center); }
.ballot-rail.cta .btn { justify-self: start; margin-top: 6px; }

/* States page entry card */
.ballot-entry {
  display: flex; align-items: center; gap: 14px; text-decoration: none; margin: 0 0 12px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 5px solid var(--center);
  min-height: 64px;
}
.ballot-entry:hover { border-left-color: var(--ink); }
.ballot-entry-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--center-soft); color: var(--center); font-size: 22px; flex: none; }
.ballot-entry b { display: block; font: 800 17px/1.2 var(--display); }
.ballot-entry small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.ballot-entry .arrow { margin-left: auto; font-size: 20px; color: var(--ink-2); }

/* ---------- Email verification ---------- */
.verify-banner {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 14px;
  border-left: 5px solid var(--glow); font-size: 14px;
}
.verify-banner .verify-note { display: block; margin-top: 4px; }
.verify-page { max-width: 520px; margin: 24px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.verify-page h1 { font-size: clamp(28px, 7vw, 38px); }
.verify-page p { margin: 0; color: var(--ink-2); }
.verify-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 800 30px var(--display); background: var(--surface-2); color: var(--ink-2); }
.verify-icon.ok { background: var(--verified); color: #fff; }
.verify-page .stack-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.email-panel .email-status { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; word-break: break-all; }
.notify-form { display: grid; gap: 4px; }
.notify-form .check-field { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.notify-form .check-field input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.notify-form .check-field.disabled { opacity: .55; cursor: not-allowed; }

.me-toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s, transform .25s; cursor: pointer;
}
@media (max-width: 520px) { .me-toast { font-size: 13px; padding: 10px 14px; } }
.me-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .me-toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .me-toast { transition: none; } }
