.vs-page {
    --vs-text: #111827;
    --vs-muted: #374151;
    --vs-soft: #4b5563;
    --vs-line: #d1d5db;
    --vs-panel: #f8fafc;
    --vs-accent: #1d4ed8;
    margin: 96px auto 56px;
    max-width: 920px;
    padding: 0 4px 48px;
    color: var(--vs-text);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.7;
}

.vs-page *,
.vs-page p,
.vs-page li,
.vs-page span,
.vs-page td,
.vs-page th {
    font-weight: inherit;
}

.vs-hero {
    margin-bottom: 28px;
    padding: 24px 24px 20px;
    border: 1px solid var(--vs-line);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.vs-hero h1,
.vs-section h2,
.vs-prose h2 {
    font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
    color: var(--vs-text);
    font-weight: 700;
    line-height: 1.25;
}

.vs-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 2.75rem);
}

.vs-section h2,
.vs-prose h2 {
    margin: 0 0 14px;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.vs-kicker {
    margin: 0 0 10px;
    color: var(--vs-accent);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.vs-hero > p:not(.vs-kicker) {
    margin: 0;
    max-width: 62ch;
    color: var(--vs-muted);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.65;
}

.vs-section p {
    max-width: 68ch;
    color: var(--vs-text);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.75;
}

.vs-search {
    display: flex;
    gap: 8px;
    max-width: 720px;
    margin-top: 18px;
}

.vs-search input,
.vs-admin-body input,
.vs-admin-body select,
.vs-admin-body textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
}

.vs-search input {
    color: var(--vs-text);
    font-size: 1rem;
    background: #fff;
}

.vs-search input::placeholder {
    color: #6b7280;
}

.vs-search button,
.vs-admin-body button {
    border: 0;
    border-radius: 8px;
    background: #1d4ed8;
    color: #fff;
    padding: 10px 16px;
    font-weight: 600;
}

.vs-breadcrumb {
    margin-bottom: 18px;
}

.vs-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.95rem;
}

.vs-breadcrumb a {
    color: var(--vs-accent);
    font-weight: 600;
    text-decoration: none;
}

.vs-breadcrumb a:hover {
    text-decoration: underline;
}

.vs-breadcrumb li {
    color: var(--vs-soft);
    font-weight: 500;
}

.vs-breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: #9ca3af;
}

.vs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.vs-card {
    display: block;
    border: 1px solid var(--vs-line);
    border-radius: 14px;
    padding: 16px;
    color: var(--vs-text);
    text-decoration: none;
    background: #fff;
}

.vs-card h3 {
    margin: 0 0 6px;
    color: var(--vs-text);
    font-size: 1.2rem;
    font-weight: 700;
}

.vs-card p,
.vs-results span,
.vs-updated {
    color: var(--vs-soft);
    font-weight: 500;
}

.vs-updated {
    margin-top: 28px;
    font-size: 0.95rem;
}

.vs-results,
.vs-seats {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vs-results li,
.vs-seats li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    color: var(--vs-text);
    font-weight: 500;
}

.vs-number {
    min-width: 2.5rem;
    color: var(--vs-accent);
    font-weight: 700;
}

.vs-badge {
    border-radius: 999px;
    background: #dbeafe;
    color: #1e3a8a;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.vs-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 0 0 28px;
}

.vs-facts div {
    border: 1px solid var(--vs-line);
    border-radius: 14px;
    padding: 14px 16px;
    background: var(--vs-panel);
}

.vs-facts span {
    display: block;
    margin-bottom: 4px;
    color: var(--vs-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.vs-facts strong {
    display: block;
    color: var(--vs-text);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
}

.vs-facts .vs-fact-meta {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    color: var(--vs-soft);
    font-size: 0.86rem;
    font-weight: 500;
}

.vs-asof {
    margin: -4px 0 14px;
    color: var(--vs-soft);
    font-size: 0.92rem;
    font-weight: 600;
}

.vs-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
    margin: 14px 0 0;
}

.vs-cta-primary {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    background: #0f766e;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.vs-cta a:not(.vs-cta-primary) {
    font-weight: 600;
}

.vs-faq details {
    border-top: 1px solid var(--vs-line);
    padding: 12px 0;
}

.vs-faq details:first-child {
    border-top: 0;
    padding-top: 0;
}

.vs-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--vs-text);
}

.vs-faq p {
    margin: 8px 0 0;
}

.vs-related,
.vs-sources {
    margin: 0;
    padding-left: 1.1rem;
}

.vs-related li,
.vs-sources li {
    margin: 0 0 8px;
}

.vs-related span {
    color: var(--vs-soft);
    margin-left: 8px;
}

.vs-election-chart {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.vs-bar-row {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    gap: 10px;
    align-items: center;
}

.vs-bar-label,
.vs-bar-value {
    font-size: 0.9rem;
    color: var(--vs-soft);
    font-weight: 600;
}

.vs-bar-track {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.vs-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0f766e;
}

.vs-share {
    margin: 0 0 8px;
}

.vs-share a {
    font-weight: 700;
}

.vs-section {
    margin: 0 0 28px;
    padding: 22px 24px;
    border: 1px solid var(--vs-line);
    border-radius: 18px;
    background: #fff;
}

.vs-table-wrap {
    overflow-x: auto;
}

.vs-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
}

.vs-page th,
.vs-page td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    color: var(--vs-text);
    vertical-align: top;
}

.vs-page th {
    color: var(--vs-soft);
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--vs-panel);
}

.vs-prose {
    max-width: none;
}

.vs-prose p,
.vs-prose li {
    color: var(--vs-text);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.75;
}

.vs-prose p {
    margin: 0 0 1em;
}

.vs-prose p:last-child {
    margin-bottom: 0;
}

.vs-prose ul,
.vs-prose ol {
    margin: 0 0 1em;
    padding-left: 1.35em;
}

.vs-prose a {
    color: var(--vs-accent);
    font-weight: 600;
}

.vs-prose strong,
.vs-prose b {
    color: var(--vs-text);
    font-weight: 700;
}

.vs-prose h3,
.vs-prose h4 {
    margin: 1.2em 0 0.55em;
    color: var(--vs-text);
    font-weight: 700;
}

@media (max-width: 700px) {
    .vs-page {
        margin-top: 84px;
    }

    .vs-hero,
    .vs-section {
        padding: 18px 16px;
    }

    .vs-search {
        flex-direction: column;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.vs-admin-body {
    margin: 0;
    background: #f8fafc;
    color: #111827;
}

.vs-admin-bar,
.vs-admin-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.vs-admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vs-admin-bar a {
    color: #312e81;
    font-weight: 700;
    text-decoration: none;
}

.vs-admin-shell {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.vs-admin-sidebar {
    position: sticky;
    top: 16px;
}

.vs-admin-workspace {
    min-width: 0;
}

.vs-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 40;
    min-width: 220px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.vs-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.vs-toast.error {
    background: #991b1b;
}

.vs-admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.vs-admin-body label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

.vs-inline-form,
.vs-form-row,
.vs-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0 16px;
}

.vs-section,
.vs-subsection {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 12px;
}

.vs-section > summary,
.vs-subsection > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    padding: 14px 16px;
}

.vs-section > summary::-webkit-details-marker,
.vs-subsection > summary::-webkit-details-marker {
    display: none;
}

.vs-section > summary::before,
.vs-subsection > summary::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid #312e81;
    border-bottom: 2px solid #312e81;
    transform: rotate(-45deg);
    flex: 0 0 auto;
}

.vs-section[open] > summary::before,
.vs-subsection[open] > summary::before {
    transform: rotate(45deg);
}

.vs-section-meta {
    margin-left: auto;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.vs-section-body {
    padding: 0 16px 16px;
}

.vs-subsection {
    background: #f8fafc;
    border-radius: 10px;
    margin: 12px 0;
}

.vs-subsection > summary {
    padding: 12px 14px;
}

.vs-subsection > :not(summary) {
    margin-left: 14px;
    margin-right: 14px;
}

.vs-subsection[open] {
    background: #fff;
    padding-bottom: 8px;
}

.vs-constituency-editor {
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.vs-constituency-editor.is-active {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.vs-constituency-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.vs-constituency-header h2 {
    margin: 4px 0 6px;
    font-size: 1.35rem;
}

.vs-constituency-header .vs-kicker {
    margin: 0;
    color: #6b7280;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vs-public-link {
    margin: 0;
    color: #4b5563;
}

.vs-inline-status {
    margin: 8px 0 0;
    min-height: 1.2em;
    color: #065f46;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.vs-inline-status.is-visible {
    opacity: 1;
}

.vs-inline-status.error {
    color: #991b1b;
}

.tox-tinymce {
    border-radius: 10px !important;
    border-color: #d1d5db !important;
}

.vs-rich-editor {
    width: 100%;
}

.vs-constituency-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vs-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.vs-editor-tabs button {
    background: #eef2ff;
    color: #312e81;
    border: 0;
}

.vs-editor-tabs button.is-active {
    background: #312e81;
    color: #fff;
}

.vs-editor-panel {
    display: none;
    animation: vs-panel-in 0.18s ease;
}

.vs-editor-panel.is-active {
    display: block;
}

.vs-content-area {
    font-family: Consolas, "Courier New", monospace;
    min-height: 180px;
}

.vs-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.vs-check input {
    width: auto;
    margin: 0;
}

@keyframes vs-panel-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vs-edit-table {
    width: 100%;
}

.vs-edit-table input,
.election-card input {
    margin-top: 4px;
}

.vs-status.error {
    color: #b91c1c;
}

.vs-admin-body button.danger,
.vs-admin-body .remove-row {
    background: #b91c1c;
}

.vs-login {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    border-radius: 14px;
    padding: 24px;
}

#search-results {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

#search-results button {
    width: 100%;
    margin-bottom: 6px;
    background: #fff;
    color: #111827;
    text-align: left;
    border: 1px solid #e5e7eb;
}

#constituency-select {
    min-height: 220px;
}

@media (max-width: 860px) {
    .vs-admin-shell,
    .vs-admin-grid,
    .vs-search,
    .vs-form-row,
    .vs-inline-form,
    .vs-constituency-header {
        display: block;
    }

    .vs-admin-sidebar {
        position: static;
    }

    .vs-constituency-actions {
        margin-top: 12px;
    }

    .vs-search button,
    .vs-inline-form button {
        margin-top: 8px;
    }
}
