:root { color-scheme: light; font-family: system-ui, -apple-system, Segoe UI, sans-serif; }
body { margin: 0; background: #f4f6f8; color: #1f2937; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.header { background: #111827; color: white; padding: 16px 24px; }
.header .inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.header a { color: white; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: white; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 8px 24px rgba(15,23,42,.06); padding: 18px; margin-bottom: 16px; }
.card h2, .card h3 { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; box-sizing: border-box; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; background: white; }
textarea { min-height: 90px; }
button, .btn { display: inline-block; border: 0; background: #2563eb; color: white; border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
button:hover, .btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.secondary, button.secondary { background: #4b5563; }
.btn.danger, button.danger { background: #dc2626; }
.btn.success, button.success { background: #059669; }
.btn.warning, button.warning { background: #d97706; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; background: #e5e7eb; }
.badge.open { background: #dbeafe; color: #1e40af; }
.badge.secret { background: #ede9fe; color: #5b21b6; }
.badge.live { background: #dcfce7; color: #166534; }
.badge.closed { background: #fee2e2; color: #991b1b; }
.badge.warning { background: #fef3c7; color: #92400e; }
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #eff6ff; border: 1px solid #bfdbfe; }
.flash.error { background: #fef2f2; border-color: #fecaca; }
.flash.success { background: #f0fdf4; border-color: #bbf7d0; }
.flash.warning { background: #fffbeb; border-color: #fde68a; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { color: #4b5563; background: #f9fafb; }
.progress { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: #2563eb; }
.small { font-size: 13px; color: #6b7280; }
.vote-option { display: block; margin: 10px 0; padding: 12px; border: 1px solid #d1d5db; border-radius: 12px; }
.vote-option input { width: auto; margin-right: 8px; }
.actions form { display: inline-block; margin: 3px 3px 3px 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f4f6; padding: 2px 5px; border-radius: 6px; }
@media (max-width: 720px) { .container { padding: 14px; } .header .inner { display: block; } table { font-size: 12px; } }

.result-summary { min-width: 180px; line-height: 1.45; }
[data-participant-live] { transition: opacity .15s ease; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.metric-card { border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background: #f9fafb; }
.metric-label { font-size: 12px; color: #4b5563; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.metric-value { font-size: 26px; line-height: 1.1; font-weight: 800; margin-top: 6px; }
.participant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.participant-tile { border: 1px solid #d1d5db; border-radius: 14px; padding: 12px; min-height: 88px; box-shadow: 0 3px 12px rgba(15,23,42,.06); }
.participant-tile.status-pending { background: #ffffff; }
.participant-tile.status-abstain { background: #e5e7eb; }
.participant-tile.status-yes { background: #dcfce7; border-color: #86efac; }
.participant-tile.status-no { background: #fee2e2; border-color: #fca5a5; }
.participant-tile.status-secret { background: #ede9fe; border-color: #c4b5fd; }
.tile-status { margin-top: 8px; font-weight: 800; }
.legend { gap: 16px; margin: 8px 0; }
.legend-box { display: inline-block; width: 16px; height: 16px; border: 1px solid #9ca3af; border-radius: 4px; vertical-align: -3px; margin-right: 5px; }
.legend-box.status-pending { background: #ffffff; }
.legend-box.status-abstain { background: #e5e7eb; }
.legend-box.status-yes { background: #dcfce7; border-color: #86efac; }
.legend-box.status-no { background: #fee2e2; border-color: #fca5a5; }


.vote-window { border-left: 6px solid #2563eb; }
.status-window { border-left: 6px solid #059669; }
.result-window { border-left: 6px solid #d97706; }
.change-vote { margin-top: 18px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.decision-box { border-radius: 14px; padding: 13px 15px; margin: 12px 0 16px; border: 1px solid #d1d5db; background: #f9fafb; }
.decision-title { font-size: 22px; line-height: 1.15; font-weight: 900; margin-bottom: 4px; }
.decision-accepted { background: #ecfdf5; border-color: #86efac; color: #14532d; }
.decision-rejected { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.decision-pending { background: #f9fafb; border-color: #d1d5db; color: #374151; }

.login-shell { max-width: 560px; margin: 40px auto; }
.login-card h1 { margin-top: 0; font-size: 32px; }
.login-button { width: 100%; padding: 14px 16px; font-size: 18px; }
.admin-login-link { text-align: center; margin-top: 18px; font-size: 12px; }
.admin-login-link a { color: #6b7280; }
.question-subtitle { font-size: 22px; color: #374151; margin-top: 4px; }
.ballot-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0; }
.ballot-choice { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 74px; border: 2px solid #d1d5db; border-radius: 16px; background: #ffffff; cursor: pointer; text-align: center; padding: 12px; flex-direction: column; }
.ballot-choice input { width: auto; }
.ballot-choice span { display: block; font-size: 12px; font-weight: 500; color: #4b5563; }
.ballot-choice:has(input:checked) { outline: 4px solid rgba(37,99,235,.18); border-color: #2563eb; }
.ballot-yes { background: #ecfdf5; border-color: #86efac; }
.ballot-no { background: #fef2f2; border-color: #fca5a5; }
.ballot-abstain { background: #f3f4f6; border-color: #d1d5db; }
.pie-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 24px auto;
    text-align: center;
}

.pie-chart {
    display: block;
    margin: 0 auto;
}

.pie-legend {
    margin-top: 16px;
    display: inline-block;
    text-align: left;
}
.pie-key { display: inline-block; width: 16px; height: 16px; border-radius: 4px; margin-right: 8px; vertical-align: -3px; background: #2563eb; }
.pie-yes { background: #16a34a; }
.pie-no { background: #dc2626; }
.pie-abstain { background: #9ca3af; }
.pie-other { background: #2563eb; }
.account-info { margin-top: 20px; }
.legend-box.status-secret { background: #ede9fe; border-color: #c4b5fd; }
.vote-slot { border: 1px solid #e5e7eb; border-radius: 16px; padding: 14px; margin: 14px 0; background: #fbfdff; }
.vote-slot h3 { margin: 0 0 2px; }
.apply-all { display: inline-flex; align-items: center; gap: 8px; width: auto; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 12px; background: #f9fafb; }
.apply-all input { width: auto; }
.proxy-select-form select { max-width: 520px; }
.proxy-ballot { margin-top: 14px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-form input { width: auto; }
.inline-form button { padding: 8px 10px; }
.participant-tile.status-mixed { background: #fef3c7; border-color: #fbbf24; }
.legend-box.status-mixed { background: #fef3c7; border-color: #fbbf24; }
