*, *::before, *::after { box-sizing: border-box; }
:root { --ink: #1c2530; --muted: #5b6672; --line: #c9d1da; --accent: #1f4e79; --bg: #f3f5f7; }
body { margin: 0; font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
.card { max-width: 680px; margin: 24px auto; padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.card.wide { max-width: 1100px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 6px; }
.masthead { text-align: center; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.masthead h1 { font-size: 2rem; text-transform: uppercase; letter-spacing: .01em; margin: 0; }
.tagline { margin: 6px 0 0; font-size: 1.15rem; color: var(--accent); }
.statement { margin-bottom: 28px; }
.statement p { margin: 0 0 8px; }
.statement h2 { margin: 26px 0 8px; font-size: 1.05rem; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; }
.statement ul { margin: 0; padding-left: 26px; }
.statement li { margin-bottom: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 600; font-size: .95rem; }
input[type=text], input[type=password] { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
input:focus-visible, button:focus-visible, canvas:focus-visible, a:focus-visible { outline: 3px solid #7fb0e0; outline-offset: 1px; }
.sig-label { display: flex; justify-content: space-between; align-items: baseline; margin-top: 20px; font-weight: 600; font-size: .95rem; }
#sigpad { display: block; width: 100%; aspect-ratio: 3 / 1; margin-top: 6px; background: #fff; border: 2px dashed var(--line); border-radius: 6px; touch-action: none; cursor: crosshair; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0; font-weight: 400; font-size: 1rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.btn { display: inline-block; padding: 12px 22px; font: inherit; font-weight: 600; color: var(--accent); background: #fff; border: 2px solid var(--accent); border-radius: 6px; text-decoration: none; cursor: pointer; }
.btn.primary { width: 100%; color: #fff; background: var(--accent); font-size: 1.1rem; padding: 14px; }
.btn.small { padding: 4px 10px; font-size: .85rem; border-width: 1px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.notice { padding: 14px 18px; margin-bottom: 20px; border-radius: 6px; background: #eef2f6; }
.notice p, .notice ul { margin: 0; }
.notice ul { padding-left: 20px; }
.notice.ok { background: #e6f4ea; }
.notice.err, .form-error { background: #fdecea; color: #8a1c13; }
.form-error { padding: 10px 14px; border-radius: 6px; }
.fine { font-size: .85rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 24px; }

/* Admin */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.stats { color: var(--muted); margin: 0 0 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td img { height: 50px; width: 150px; display: block; border: 1px solid #e3e7ec; }
tr.excluded td { background: #f6f6f6; color: #8a8f96; }
tr.excluded td.name { text-decoration: line-through; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .78rem; font-weight: 600; background: #fff1cc; color: #7a5500; }
.tag.off { background: #e4e6e9; color: #555; }
td form { display: flex; gap: 6px; }
td form input[type=text] { margin: 0; padding: 4px 8px; font-size: .85rem; width: 150px; }

@media (max-width: 520px) {
  .card { margin: 0; border: 0; border-radius: 0; padding: 20px; }
  .row { grid-template-columns: 1fr; }
  #sigpad { aspect-ratio: 2 / 1; }
}

/* Printable petition (admin export) */
.print-doc { max-width: 900px; margin: 0 auto; padding: 24px; background: #fff; }
.print-doc td img { height: 60px; width: 180px; border: 0; }
.print-doc tr { break-inside: avoid; }
.print-doc thead { display: table-header-group; }
@media print {
  body { background: #fff; font-size: 11pt; }
  .no-print { display: none !important; }
  .print-doc { padding: 0; max-width: none; }
  .masthead h1 { font-size: 1.5rem; }
  .statement li { margin-bottom: 2px; }
}
