:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #1d2733;
    --muted: #5f6d7a;
    --line: #d9e0e7;
    --nav: #205070;
    --primary: #dc3545;
    --danger: #dc3545;
    --soft: #eef3f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.vote-shell {
    align-items: start;
    place-items: start center;
    padding: 28px 20px;
}

.panel {
    width: min(100%, 560px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 14px 34px rgba(20, 32, 44, 0.08);
}

.vote-panel {
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.14;
}

.vote-header {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 26px 28px 18px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.vote-kicker {
    margin: 0;
    color: var(--nav);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.vote-title {
    max-width: 780px;
    margin: 0;
    text-align: center;
}

.vote-welcome {
    max-width: 760px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    margin-top: 0;
}

.form {
    display: grid;
    gap: 16px;
}

.vote-panel .form {
    gap: 16px;
    padding: 22px 28px 28px;
}

.access-code-form {
    max-width: 560px;
    margin: 0 auto;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input, textarea, select, button {
    font: inherit;
}

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--nav);
    box-shadow: 0 0 0 3px rgba(32, 80, 112, 0.12);
    outline: none;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover,
button:focus {
    box-shadow: 0 7px 16px rgba(220, 53, 69, 0.18);
    transform: translateY(-1px);
}

button:disabled:hover,
button:disabled:focus {
    box-shadow: none;
    transform: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.alert {
    border-radius: 6px;
    padding: 14px;
    margin: 16px 0;
    line-height: 1.6;
}

.vote-panel > .alert {
    margin: 16px 28px;
}

.vote-panel .form .alert {
    margin: 0;
}

.success {
    background: #e8f7f3;
    border: 1px solid #9bd8cb;
}

.error {
    background: #fff1f0;
    border: 1px solid #f4b8b1;
    color: var(--danger);
}

code {
    display: inline-block;
    margin: 4px 0;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--soft);
}

.motions-heading {
    margin: 0;
    text-align: center;
    color: #444;
    font-size: 26px;
    font-weight: 400;
}

.motion-card {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 22px 24px 24px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--nav);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 32, 44, 0.08);
}

.motion-card legend.sr-only {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.motion-header-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    table-layout: fixed;
}

.motion-header-table td {
    border: 0;
    padding: 0;
    vertical-align: top;
}

.motion-resolution-cell {
    text-align: right;
    width: 34%;
}

.motion-header-table h3,
.motion-resolution,
.motion-proposed,
.motion-body,
.motion-note,
.answer-prompt {
    margin: 0;
}

.motion-header-table h3 {
    color: var(--text);
    font-size: 19px;
    font-weight: 700;
}

.motion-resolution {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--soft);
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
}

.motion-proposed {
    margin-top: 4px;
    color: var(--muted);
    font-style: italic;
    font-weight: 700;
}

.motion-body {
    color: #2f3944;
    font-size: 18px;
    line-height: 1.55;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote,
.rich-content table {
    margin: 0 0 10px;
}

.rich-content p:last-child,
.rich-content ul:last-child,
.rich-content ol:last-child,
.rich-content blockquote:last-child,
.rich-content table:last-child {
    margin-bottom: 0;
}

.rich-content h3,
.rich-content h4 {
    margin: 0 0 8px;
    color: var(--nav);
    line-height: 1.25;
}

.rich-content h3 {
    font-size: 20px;
}

.rich-content h4 {
    font-size: 17px;
}

.rich-content blockquote {
    border-left: 3px solid var(--nav);
    padding-left: 12px;
    color: var(--muted);
}

.rich-content ul,
.rich-content ol {
    padding-left: 24px;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
}

.rich-content th,
.rich-content td {
    padding: 8px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.motion-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--nav);
}

.motion-note span,
.motion-attachments span,
.answer-prompt span {
    display: inline-grid;
    place-items: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #071b3d;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.motion-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.motion-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border: 1px solid #cbd5df;
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--nav);
    text-decoration: none;
    font-weight: 700;
}

.motion-attachments a:hover,
.motion-attachments a:focus {
    background: var(--soft);
    text-decoration: none;
}

.answer-prompt {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #071b3d;
    font-size: 14px;
}

.answer-block {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}

.choice-list {
    display: grid;
    gap: 7px;
    margin-top: 0;
}

.choice {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 28px;
    color: var(--text);
    font-weight: 700;
}

.choice input {
    width: auto;
}

.vote-security-note {
    border-color: #9ddac6;
    background: #e9faf4;
    color: #14664e;
}

@media (max-width: 700px) {
    .vote-shell {
        padding: 12px;
    }

    .panel,
    .vote-panel {
        border-radius: 8px;
    }

    .vote-header {
        padding: 20px 16px 16px;
    }

    h1 {
        font-size: 26px;
    }

    .vote-panel .form {
        padding: 16px;
    }

    .alert {
        margin: 14px 16px;
    }

    .panel:not(.vote-panel) .alert {
        margin-right: 0;
        margin-left: 0;
    }

    .motion-card {
        padding: 16px;
    }

    .motion-header-table,
    .motion-header-table tbody,
    .motion-header-table tr,
    .motion-header-table td {
        display: block;
        width: 100%;
    }

    .motion-resolution-cell {
        margin-top: 8px;
        text-align: left;
    }

    .motion-resolution {
        white-space: normal;
    }
}
