/* The Ledger Poll. One stylesheet for every place a poll appears: the shell links it, and
   scripts/poll_block.py copies it into a paper's poll block so the paper (and its PNG and PDF)
   carry the printed card on their own. Every selector starts with .ledger-poll. */
.ledger-poll { --lp-ink: #1a1710; --lp-paper: #f4eeda; --lp-tint: #efe6c8; --lp-rule: #c9bd9c; --lp-soft: #5f5c52; --lp-sage: #b9c9a3; --lp-sage-t: #e4ebd9; --lp-sage-ink: #2f6b3f; --lp-rose-ink: #9b2c1f; --lp-bar: #e3d6ae;
  display: block; box-sizing: border-box; max-width: 100%; margin: 16px 0 6px; padding: 13px 18px 12px; border: 3px double var(--lp-ink); background: var(--lp-tint); color: var(--lp-ink); font-family: inherit; text-align: left; }
.ledger-poll * { box-sizing: border-box; }
.ledger-poll .lp-tag { font-size: 11.5px; letter-spacing: 3px; text-transform: uppercase; margin: 0 0 5px; }
.ledger-poll .lp-q { font-size: 26px; line-height: 1.14; font-weight: 900; margin: 0 0 10px; }
/* the printed card: a ballot, no buttons */
.ledger-poll .lp-list { list-style: none; margin: 0 0 10px; padding: 0; }
.ledger-poll .lp-list li { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0; padding: 6px 2px; border-top: 1px solid var(--lp-rule); font-size: 18px; line-height: 1.3; }
.ledger-poll .lp-list li:last-child { border-bottom: 1px solid var(--lp-rule); }
.ledger-poll .lp-box { flex: none; width: 20px; height: 20px; border: 2px solid var(--lp-ink); background: var(--lp-paper); }
.ledger-poll .lp-foot { font-size: 14px; line-height: 1.4; font-style: italic; margin: 0; }
.ledger-poll .lp-foot a { color: inherit; font-style: normal; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* the live poll (the reader, the poll's own page, and a paper opened on its own) */
.ledger-poll.lp-live .lp-opts { display: grid; gap: 8px; margin: 0 0 10px; }
.ledger-poll .lp-opt { position: relative; display: block; width: 100%; min-height: 52px; margin: 0; padding: 0; border: 1.5px solid var(--lp-ink); border-radius: 0; background: var(--lp-paper); color: var(--lp-ink); font: inherit; text-align: left; cursor: pointer; overflow: hidden; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ledger-poll .lp-opt:focus-visible { outline: 3px solid var(--lp-sage-ink); outline-offset: 2px; }
.ledger-poll .lp-bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--lp-bar); transition: width .35s cubic-bezier(.2,.75,.2,1); }
.ledger-poll .lp-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 8px 12px; }
.ledger-poll .lp-mark { flex: none; width: 20px; height: 20px; border: 2px solid var(--lp-ink); border-radius: 50%; background: var(--lp-paper); display: grid; place-items: center; }
.ledger-poll .lp-label { flex: 1 1 auto; min-width: 0; font-size: 17px; line-height: 1.25; }
.ledger-poll .lp-n { flex: none; width: 5.2em; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-poll .lp-opt[aria-pressed="true"] { border-width: 1.5px; box-shadow: inset 0 0 0 1.5px var(--lp-ink); }
.ledger-poll .lp-opt[aria-pressed="true"] .lp-bar { background: var(--lp-sage); }
.ledger-poll .lp-opt[aria-pressed="true"] .lp-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lp-ink); }
.ledger-poll .lp-opt[aria-pressed="true"] .lp-label { font-weight: 700; }
.ledger-poll .lp-opt.lp-pending .lp-mark { border-style: dashed; animation: lp-spin 1.2s linear infinite; }
.ledger-poll .lp-opt[aria-disabled="true"] { cursor: default; }
@keyframes lp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ledger-poll .lp-bar { transition: none; } .ledger-poll .lp-opt.lp-pending .lp-mark { animation: none; } }
.ledger-poll .lp-status { min-height: 2.8em; margin: 0 0 6px; font-size: 15px; line-height: 1.4; }
.ledger-poll .lp-status.lp-err { color: var(--lp-rose-ink); }
.ledger-poll .lp-status button, .ledger-poll .lp-status a { font: inherit; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 6px 0; margin: 0; cursor: pointer; }
.ledger-poll .lp-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; font-size: 13.5px; line-height: 1.4; color: var(--lp-soft); font-style: italic; }
.ledger-poll .lp-share { flex: none; min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--lp-ink); border-radius: 999px; background: var(--lp-paper); color: var(--lp-ink); font: inherit; font-style: normal; font-size: 14px; cursor: pointer; }
.ledger-poll .lp-share:focus-visible { outline: 3px solid var(--lp-sage-ink); outline-offset: 2px; }
.ledger-poll a.lp-share { display: inline-flex; align-items: center; text-decoration: none; }

/* the Front's card: the same poll, smaller type */
.ledger-poll.lp-compact { margin: 0; padding: 10px 12px 10px; }
.ledger-poll.lp-compact .lp-q { font-size: 21px; margin-bottom: 8px; }
.ledger-poll.lp-compact .lp-opts { gap: 6px; }
.ledger-poll.lp-compact .lp-opt { min-height: 46px; }
.ledger-poll.lp-compact .lp-row { min-height: 43px; padding: 6px 10px; }
.ledger-poll.lp-compact .lp-label { font-size: 15.5px; }
.ledger-poll.lp-compact .lp-status { font-size: 14px; }
.ledger-poll.lp-compact .lp-list li { min-height: 34px; font-size: 16px; }

/* the final count, printed in the next paper (and its PNG and PDF): static, from the closing snapshot */
.ledger-poll .lp-res { list-style: none; margin: 0 0 10px; padding: 0; }
.ledger-poll .lp-res li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; margin: 0; padding: 7px 2px 8px; border-top: 1px solid var(--lp-rule); font-size: 17px; line-height: 1.3; }
.ledger-poll .lp-res li:last-child { border-bottom: 1px solid var(--lp-rule); }
.ledger-poll .lp-rn { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.ledger-poll .lp-rbar { grid-column: 1 / -1; display: block; height: 10px; border: 1px solid var(--lp-ink); background: var(--lp-paper); }
.ledger-poll .lp-rbar span { display: block; height: 100%; background: var(--lp-bar); }
.ledger-poll .lp-res li.lp-top .lp-rl { font-weight: 700; }
.ledger-poll .lp-res li.lp-top .lp-rbar span { background: var(--lp-sage); }
@media (max-width: 520px) {
  .ledger-poll { padding: 11px 12px 10px; }
  .ledger-poll .lp-q { font-size: 22px; }
  .ledger-poll .lp-label { font-size: 16px; }
  .ledger-poll .lp-n { width: 4.6em; font-size: 14px; }
  .ledger-poll .lp-status { min-height: 5.6em; }   /* the longest error line is four lines at 390 px: room for it, so the card never grows */
}
