:root {
    --bg: #f7f9f4;
    --surface: #ffffff;
    --ink: #17201d;
    --muted: #64706b;
    --line: #d9e0dc;
    --brand: #009933;
    --brand-strong: #006b24;
    --accent: #FFD700;
    --accent-soft: #fff7bf;
    --accent-line: #e6c200;
    --warning: #a76513;
    --danger: #ad2f2f;
    --ok: #0f7b45;
    --shadow: 0 18px 40px rgba(26, 37, 33, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 76px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
}

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    margin-top: 2px;
}

.nav {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.nav a {
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.nav a.active,
.nav a:hover {
    color: var(--brand-strong);
    background: var(--accent-soft);
}

.logout-form {
    margin: 0;
}

.shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 46px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.12;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.08rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 750;
}

.primary-btn {
    background: var(--brand);
    color: #fff;
}

.primary-btn:hover {
    background: var(--brand-strong);
}

.secondary-btn {
    background: #fff;
    border-color: var(--accent-line);
    color: var(--brand-strong);
}

.danger-btn {
    background: var(--danger);
    color: #fff;
}

.ghost-btn,
.icon-btn {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
}

.small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.86rem;
}

.full {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.stat-card,
.panel,
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    min-height: 38px;
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
}

.stat-card.muted strong {
    color: var(--warning);
}

.split,
.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(330px, 0.85fr);
    gap: 16px;
}

.entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    gap: 16px;
    align-items: start;
}

.left-stack,
.right-stack {
    display: grid;
    gap: 16px;
}

.right-stack {
    position: sticky;
    top: 96px;
}

.section-panel {
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.mini-stat {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.mini-stat span {
    display: block;
    min-height: 34px;
    color: var(--muted);
    font-weight: 760;
}

.mini-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 1.65rem;
}

.panel {
    padding: 18px;
    min-width: 0;
}

.panel > h2 {
    margin-bottom: 16px;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
}

.pill.ok {
    background: #e6f7ea;
    color: var(--ok);
}

.pill.no {
    background: #f8e9e9;
    color: var(--danger);
}

.export-list {
    display: grid;
    gap: 10px;
}

.export-list a {
    padding: 13px 14px;
    border: 1px solid var(--accent-line);
    border-radius: 8px;
    background: #fbfcfb;
    font-weight: 750;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.profile-link {
    color: var(--brand-strong);
    font-weight: 820;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 740;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.12);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stack {
    display: grid;
    gap: 14px;
}

.results {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.result-card button:disabled,
.primary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.result-card strong,
.result-card span {
    display: block;
}

.result-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.9rem;
}

.signature-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.signature-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-weight: 760;
}

.signature-pad {
    display: block;
    width: 100%;
    height: 180px;
    touch-action: none;
    background: #fff;
}

.member-dialog {
    width: min(780px, calc(100% - 28px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.member-profile-empty {
    display: grid;
    place-items: center;
    min-height: 260px;
    text-align: center;
}

.member-profile-empty[hidden],
.member-profile-panel[hidden] {
    display: none;
}

.member-profile-empty img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.member-profile-empty p {
    max-width: 34ch;
    margin: 10px auto 0;
    color: var(--muted);
    line-height: 1.45;
}

.member-profile-panel form {
    display: grid;
    gap: 16px;
}

.identity-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8faf9;
}

.identity-logo {
    width: 74px;
    height: 74px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.identity-card h2 {
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.profile-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 16px;
    align-items: start;
}

.profile-detail-facts {
    margin-top: 16px;
}

.profile-signature-box {
    display: grid;
    place-items: center;
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
}

.profile-signature-box img {
    max-width: 100%;
    max-height: 210px;
    object-fit: contain;
}

.quorum-panel {
    margin-bottom: 16px;
    box-shadow: none;
}

.panel .quorum-panel {
    margin: 0 0 14px;
    background: #fbfcfb;
}

.quorum-panel.reached {
    border-color: rgba(0, 153, 51, 0.35);
}

.quorum-panel.pending {
    border-color: rgba(167, 101, 19, 0.35);
}

.quorum-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.quorum-main p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.quorum-count {
    min-width: 190px;
    text-align: right;
}

.quorum-count strong,
.quorum-count span {
    display: block;
}

.quorum-count strong {
    color: var(--brand-strong);
    font-size: 2.2rem;
    line-height: 1;
}

.quorum-count span {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 780;
}

.quorum-bar {
    height: 12px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2ef;
}

.quorum-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.quorum-panel.pending .quorum-bar span {
    background: var(--warning);
}

.quorum-note {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 760;
}

.result-lock {
    display: grid;
    gap: 14px;
}

.result-lock-body {
    display: grid;
    gap: 12px;
}

.result-lock-body h2 {
    margin: 0;
}

.result-lock-body p {
    margin: 0;
    color: var(--muted);
    font-weight: 760;
}

.post-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.post-tabs a {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
}

.post-tabs a.active {
    border-color: var(--brand);
    background: var(--accent-soft);
    color: var(--brand-strong);
}

.candidate-admin-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
    gap: 16px;
    margin-bottom: 18px;
}

.check-row {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    height: 18px;
}

.candidate-grid,
.counting-grid,
.results-grid {
    scroll-margin-top: 92px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.candidate-card,
.candidate-vote-card button,
.result-card-large {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.candidate-card {
    display: grid;
    grid-template-rows: auto 1fr;
}

.candidate-card.inactive {
    opacity: 0.62;
}

.candidate-card-body {
    display: grid;
    grid-template-rows: auto minmax(3.4em, auto);
    align-content: start;
    gap: 10px;
    padding: 14px;
}

.candidate-card-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.candidate-number {
    display: inline-grid;
    min-height: 30px;
    place-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(0, 153, 51, 0.1);
    color: var(--brand-strong);
    font-size: 0.8rem;
    font-weight: 900;
}

.candidate-card-body h2,
.result-card-large h2,
.candidate-vote-card strong {
    margin: 0;
    overflow-wrap: anywhere;
}

.candidate-card-body > .secondary-btn {
    align-self: end;
}

.candidate-card-body p,
.result-card-large p,
.candidate-vote-card em {
    margin: 0;
    color: var(--muted);
    font-style: normal;
}

.candidate-photo,
.vote-photo,
.result-photo,
.presentation-photo {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center top;
    background: #edf2ef;
}

.candidate-photo {
    height: clamp(190px, 18vw, 240px);
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.vote-photo {
    height: clamp(170px, 24vw, 230px);
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.result-photo {
    height: clamp(150px, 20vw, 210px);
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.presentation-photo {
    height: 100%;
    min-height: 280px;
}

.missing-photo {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 16px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.shortcut-badge {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border-radius: 8px;
    background: var(--accent);
    color: #17201d;
    font-weight: 900;
}

.candidate-vote-card {
    margin: 0;
}

.candidate-vote-card button {
    display: grid;
    gap: 10px;
    width: 100%;
    min-height: 100%;
    padding: 12px;
    cursor: pointer;
    color: var(--ink);
    text-align: left;
}

.candidate-vote-card button:hover,
.candidate-vote-card button:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.12), var(--shadow);
}

.candidate-vote-card button:disabled,
.count-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.54;
    filter: grayscale(0.2);
}

.counting-grid.is-locked .candidate-vote-card button:hover,
.counting-grid.is-locked .candidate-vote-card button:focus-visible {
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.quorum-lock {
    margin: 0 0 16px;
}

.candidate-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 2px;
    color: var(--ink);
}

.candidate-facts.compact {
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 0.86rem;
}

.candidate-facts strong {
    display: block;
    margin-bottom: 4px;
    color: var(--brand-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.candidate-facts ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 17px;
}

.candidate-facts li {
    overflow-wrap: anywhere;
}

.candidate-textareas {
    align-items: stretch;
}

.presentation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.presentation-section {
    margin: 0 0 28px;
}

.presentation-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-bottom: 14px;
}

.presentation-section-head h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.presentation-section-head strong {
    color: var(--brand-strong);
    white-space: nowrap;
}

.presentation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 16px;
}

.presentation-card {
    display: grid;
    grid-template-columns: minmax(170px, 0.55fr) minmax(0, 1.45fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.presentation-card-body {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 18px;
}

.presentation-card-body h2 {
    margin: 0;
    font-size: clamp(1.25rem, 1.6vw, 1.7rem);
    overflow-wrap: anywhere;
}

.presentation-card-body p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.vote-count {
    display: block;
    color: var(--brand-strong);
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
}

.count-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.count-actions form {
    flex: 1 1 180px;
}

.count-actions button {
    width: 100%;
}

.tally-alert {
    margin: 14px 0 0;
}

.result-card-large {
    display: grid;
}

.result-card-large.winner {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 107, 95, 0.12), var(--shadow);
}

.result-card-large > div {
    display: grid;
    gap: 6px;
    padding: 14px;
}

.result-card-large strong {
    color: var(--brand-strong);
    font-size: 1.45rem;
}

.projection-screen {
    min-height: calc(100vh - 140px);
}

.projection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.projection-toolbar .post-tabs {
    margin-bottom: 0;
}

.projection-head {
    margin-bottom: 18px;
    text-align: center;
}

.projection-head h1 {
    font-size: 3rem;
}

.winner-mode {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 120px);
}

.winner-mode .projection-toolbar {
    align-self: start;
    justify-self: stretch;
    width: 100%;
}

.winner-announcement {
    display: grid;
    place-items: center;
    gap: 12px;
    width: min(780px, 100%);
    text-align: center;
}

.winner-announcement h1 {
    font-size: 3.2rem;
}

.winner-announcement h2 {
    color: var(--brand-strong);
    font-size: 2rem;
}

.winner-announcement p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 1.25rem;
    font-weight: 800;
}

.winner-photo {
    display: block;
    width: min(340px, 78vw);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 8px solid #fff;
    border-radius: 50%;
    box-shadow: 0 28px 80px rgba(23, 32, 29, 0.22);
    animation: winnerTurn 30s ease-in-out 1;
}

.winner-ranking {
    width: min(820px, 100%);
    margin: 18px auto 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.winner-ranking h2 {
    margin: 0 0 12px;
    text-align: center;
}

.winner-ranking ol {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.winner-ranking li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f7faf8;
}

.winner-ranking li.winner {
    background: var(--accent-soft);
    color: var(--brand-strong);
}

.winner-ranking span {
    overflow-wrap: anywhere;
    font-weight: 900;
}

.winner-ranking strong {
    white-space: nowrap;
}

@keyframes winnerTurn {
    0% {
        transform: rotateY(0deg) scale(0.88);
        opacity: 0.45;
    }
    12% {
        transform: rotateY(360deg) scale(1);
        opacity: 1;
    }
    50% {
        transform: rotateY(1080deg) scale(1.06);
    }
    100% {
        transform: rotateY(2160deg) scale(1);
        opacity: 1;
    }
}

.member-dialog::backdrop {
    background: rgba(23, 32, 29, 0.48);
}

.member-dialog form {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.dialog-head,
.dialog-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.member-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.member-facts div {
    padding: 10px;
    border-radius: 8px;
    background: #f5faf2;
}

.member-facts dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.member-facts dd {
    margin: 4px 0 0;
    min-height: 20px;
    overflow-wrap: anywhere;
}

.notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 720;
}

.notice.success {
    color: var(--ok);
    background: #eaf7ef;
}

.notice.warning {
    color: var(--warning);
    background: #fff6e8;
}

.notice.danger {
    color: var(--danger);
    background: #fbeaea;
}

.empty,
.hint,
.muted-text {
    color: var(--muted);
}

.hint {
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    background: var(--accent-soft);
    line-height: 1.45;
}

.big-number {
    margin: 0;
    color: var(--brand-strong);
    font-size: 3rem;
    font-weight: 850;
}

.login-panel {
    min-height: calc(100vh - 150px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: center;
    gap: 26px;
}

.login-copy h1 {
    font-size: 4rem;
}

.login-copy p:last-child {
    color: var(--muted);
    font-size: 1.1rem;
}

.login-card {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.register-list {
    display: grid;
    gap: 10px;
}

.register-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 220px;
    gap: 12px;
    align-items: center;
    min-height: 104px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.register-row span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.rank {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--brand-strong);
    font-weight: 850;
}

.signature-preview {
    display: grid;
    place-items: center;
    min-height: 74px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fff;
}

.signature-preview img {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
}

.print-title {
    display: none;
}

.error-panel {
    max-width: 720px;
    margin: 40px auto;
}

@media (max-width: 920px) {
    .topbar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .brand {
        flex: 1 1 100%;
    }

    .nav {
        order: 3;
        flex-basis: 100%;
    }

    .stats-grid,
    .split,
    .workbench,
    .entry-grid,
    .profile-detail-grid,
    .candidate-admin-grid,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .right-stack {
        position: static;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .member-facts,
    .profile-facts,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .actions > * {
        flex: 1 1 180px;
    }

    .projection-toolbar {
        display: grid;
    }

    .quorum-main {
        display: grid;
    }

    .quorum-count {
        min-width: 0;
        text-align: left;
    }

    .register-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .signature-preview {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 18px, 1180px);
        padding-top: 18px;
    }

    h1 {
        font-size: 1.55rem;
    }

    .login-copy h1 {
        font-size: 2.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .result-card,
    .dialog-head,
    .dialog-actions {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .dashboard-table {
        overflow-x: visible;
    }

    .dashboard-table table,
    .dashboard-table thead,
    .dashboard-table tbody,
    .dashboard-table tr,
    .dashboard-table td {
        display: block;
        width: 100%;
    }

    .dashboard-table thead {
        display: none;
    }

    .dashboard-table tr {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fbfcfb;
    }

    .dashboard-table tr + tr {
        margin-top: 10px;
    }

    .dashboard-table td {
        display: grid;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 7px 0;
        border-bottom: 0;
    }

    .dashboard-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 850;
        text-transform: uppercase;
    }

    .export-list a,
    .primary-btn,
    .secondary-btn,
    .danger-btn {
        width: 100%;
    }

    .profile-signature-box {
        min-height: 150px;
    }

    .candidate-grid,
    .counting-grid,
    .results-grid,
    .presentation-grid {
        grid-template-columns: 1fr;
    }

    .presentation-card {
        grid-template-columns: 1fr;
    }

    .presentation-photo {
        height: 260px;
        min-height: 0;
    }

    .candidate-facts {
        grid-template-columns: 1fr;
    }

    .projection-head h1,
    .winner-announcement h1 {
        font-size: 2rem;
    }

    .winner-announcement h2 {
        font-size: 1.4rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .print-hide,
    .notice {
        display: none !important;
    }

    .shell {
        width: 100%;
        padding: 0;
    }

    .print-title {
        display: block;
        margin-bottom: 16px;
    }

    .register-row {
        break-inside: avoid;
        box-shadow: none;
    }
}
