/* Open Vote: what this demo adds to the kit (kit/kit.css). No inline styles: the sites send
   default-src 'self'. Bars are SVG with a width attribute. */

/* Three numbers in a row, also on phones */
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats3 .stat { min-width: 0; background: var(--card); box-shadow: var(--shadow); }
.stats3 .stat b { overflow-wrap: anywhere; }
.stat.amber b { color: var(--amber-ink); }
.hero-card.amber { background: var(--amber-ink); }

/* Member avatars */
.av { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff; font: 700 15px/1 var(--display); background: var(--ink-soft); }
.av-m1 { background: var(--blue); }
.av-m2 { background: var(--green-ink); }
.av-m3 { background: var(--amber-ink); }
.av-m4 { background: var(--blue-deep); }
.av-m5 { background: var(--ink); }
.av-m6 { background: var(--ink-soft); }

/* Demo switch: whose phone this is */
.who { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 6px; border-radius: 16px; background: var(--paper-2); }
.who-label { font: 700 11px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding-left: 4px; }
.who-row { display: flex; gap: 2px; }
.who-btn { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; font: 600 11.5px/1.1 var(--display); color: var(--ink-faint); }
.who-btn .av { width: 34px; height: 34px; opacity: .5; }
.who-btn.on { color: var(--ink); }
.who-btn.on .av { opacity: 1; box-shadow: 0 0 0 2px var(--paper-2), 0 0 0 4px var(--blue); }
.who-n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* An open vote on the phone */
.vote-card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.vote-card h3 { font: 700 22px/1.22 var(--display); letter-spacing: -.015em; overflow-wrap: anywhere; }
.vc-turnout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; font: 600 13px/1 var(--display); color: var(--ink-faint); }
.big-choices { display: flex; flex-direction: column; gap: 8px; }
.bc { min-height: 60px; border-radius: 16px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 20px/1 var(--display); cursor: pointer; }
.bc-yes { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.bc-no { border-color: color-mix(in srgb, var(--red-ink) 35%, transparent); background: var(--red-soft); color: var(--red-ink); }
.bc:hover { border-color: var(--ink); }
.confirm { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--green-ink); color: #fff; }
.confirm .glyph { width: 44px; height: 44px; padding: 3px; background: #fff; border-radius: 12px; }
.confirm div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.confirm span { font-size: 13px; opacity: .9; }
.receipt-code { font: 700 25px/1.1 var(--mono); overflow-wrap: anywhere; }
.vc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vc-actions .btn { flex: 1; min-width: 130px; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 14px; margin-top: 6px; }
.check .glyph { width: 24px; height: 24px; }
.check.ok { background: var(--blue-soft); color: var(--blue-deep); }
.check.bad { background: var(--red-soft); color: var(--red-ink); }
.rows .grow .check span { color: inherit; }
.fine.center { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.fine.center .glyph { width: 18px; height: 18px; }

/* Lists and empty states */
.list-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 2px 14px; }
.rows li.top { align-items: flex-start; }
.rows .grow strong.mono { font: 700 15px/1.3 var(--mono); }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 16px; color: var(--ink-faint); }
.empty strong { font: 700 17px/1.2 var(--display); color: var(--ink); }
.how { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.how summary { font: 700 14.5px/1.3 var(--display); cursor: pointer; min-height: 24px; }
.how ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-soft); }

/* Desk apps */
.desk-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.form-narrow { max-width: 680px; }
.vote-top { display: flex; align-items: flex-start; gap: 12px; }
.vote-top .glyph { width: 44px; height: 44px; padding: 4px; background: var(--paper-2); border-radius: 12px; }
.vote-top .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.vote-top h3 { font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.turnout { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.roll { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.roll-m { display: inline-flex; align-items: center; gap: 8px; font: 600 14.5px/1 var(--display); }
.approved { border: 2px solid var(--green); }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big-amount { font: 800 30px/1 var(--display); letter-spacing: -.02em; }
.num.in { color: var(--green-ink); }

/* Tally bars */
.tally { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tally li { display: grid; grid-template-columns: minmax(56px, 84px) minmax(0, 1fr) 30px; align-items: center; gap: 10px; }
.t-label { font: 600 14px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-bar { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; }
.t-bg { fill: var(--rule); }
.t-fill { fill: var(--blue); }
.t-fill.win { fill: var(--green); }
.tally .num { text-align: right; }

/* Recount */
.recount { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 14px; font-size: 14px; }
.recount .glyph { width: 28px; height: 28px; }
.recount .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.recount strong { font: 700 15px/1.2 var(--display); }
.recount.match { background: var(--green-soft); color: var(--green-ink); }
.recount.mismatch { background: var(--red-soft); color: var(--red-ink); }
.rc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto 1fr auto; gap: 3px 12px; font-variant-numeric: tabular-nums; }
.rc li { display: contents; }

/* Big focal numbers on the desk */
.desk-body .stats3 .stat { padding: 14px 16px; }
.desk-body .stats3 .stat b { font-size: 30px; }

@media (max-width: 900px) {
  .desk-cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  /* Desk header on a phone: name + action on one line, the nav as its own row below
     (works around the kit's header, which squeezes the nav into a column at this width). */
  .desk-top { gap: 10px; }
  .desk-title { flex: 1; min-width: 0; margin-right: 0; }
  .desk-actions { margin-left: 0; }
  .desk-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .desk-nav button { white-space: nowrap; }
  .stats3 { gap: 8px; }
  .stats3 .stat, .desk-body .stats3 .stat { padding: 10px; }
  .stats3 .stat b, .desk-body .stats3 .stat b { font-size: 19px; }
  .stats3 .stat span { font-size: 12px; }
  .vote-card h3 { font-size: 20px; }
  .receipt-code { font-size: 22px; }
}
