/* Importera typsnitt */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Sans+Pro:wght@400;600&display=swap');

/* CSS Variabler för enklare temahantering */
:root {
    --primary-color: #2c3e50; /* Mörk skifferblå */
    --secondary-color: #34495e; /* Något ljusare skifferblå */
    --accent-color: #e67e22; /* Varm orange/gul */
    --background-color: #ecf0f1; /* Ljusgrå bakgrund */
    --surface-color: #ffffff; /* Vit för kort och ytor */
    --text-color: #2c3e50; /* Mörk textfärg för läsbarhet */
    --text-color-light: #7f8c8d; /* Ljusare text för metadata etc. */
    --border-color: #bdc3c7; /* Diskret kantlinjefärg */

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Source Sans Pro', sans-serif;
}

/* Baslayout */
body.theme-valu {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-color);
}

/* Header */
.top-nav-valu {
    min-height: 64px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.brand-valu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-color);
}

.brand-icon-valu {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #e6f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .brand-icon-valu svg {
        width: 22px;
        height: 22px;
    }

    .brand-icon-valu .ov-logo-img {
        display: block;
        height: 40px;
        width: auto;
    }

.icon-ring-valu {
    stroke: #2563eb33;
    stroke-width: 1.6px;
    fill: none;
}

.icon-check-valu {
    stroke: #2563eb;
    stroke-width: 2.2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.brand-title-valu {
    font-weight: 600;
    font-size: 1.15rem;
}

.brand-subtitle-valu {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
}

.main-nav-valu .nav-link-valu {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all .2s ease-in-out;
}

.main-nav-valu .nav-link-valu:hover {
    color: var(--primary-color);
    background-color: var(--background-color);
}

/* Mobile navigation */
.navbar-toggler {
    padding: 0.4rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    width: 1.25em;
    height: 1.25em;
}

@media (max-width: 576px) {
    .top-nav-valu .container-xl {
        flex-wrap: wrap;
    }

    .brand-subtitle-valu {
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .top-nav-valu .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .top-nav-valu .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem 0;
        margin-top: 0.5rem;
        border-top: 1px solid #e5e7eb;
    }
    
    .main-nav-valu {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .main-nav-valu .nav-link-valu {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        display: block;
    }
    
    .ov-logo-img {
        height: 40px;
        width: auto;
    }
}

/* Main */
.main-valu {
    min-height: calc(100vh - 120px);
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Hero */
.hero-valu {
    background: radial-gradient(circle at 20% 20%, #1f59c4, #0d2351 70%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 36px rgba(9,12,36,0.22);
    position: relative;
    overflow: hidden;
    color: #e5edff;
}

/* Hero OV - Opinionsvalet clean hero style */
.hero-ov {
    background: linear-gradient(135deg, #f8fbff 0%, #eef3ff 100%);
    border-radius: 1rem;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    border: 1px solid #d5def5;
}

.hero-bg-sverige {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(110deg, rgba(0, 12, 28, 0.92) 0%, rgba(0, 16, 30, 0.85) 30%, rgba(0, 20, 40, 0.55) 60%, rgba(0, 25, 50, 0.10) 100% ), url('/images/hero-opinionsvalet.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 0.92;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-kicker-valu {
    display: inline-flex;
    padding: 0.15rem 0.9rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #1d4ed8;
    background-color: #e0ebff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.hero-title-valu {
    margin-top: 0.7rem;
    font-size: clamp(2.2rem, 3vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.hero-text-valu {
    margin-top: 0.6rem;
    font-size: 1.05rem;
    color: #e5edff;
    max-width: 600px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.hero-meta-valu .meta-label-valu {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.hero-meta-valu .meta-value-valu {
    font-size: 0.86rem;
    color: #111827;
}

.hero-chartcard-valu.glassy {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: #fff;
}

/* Buttons override */
.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    border-radius: 999px;
    font-weight: 500;
}

    .btn-primary:hover {
        background-color: #1d4ed8;
        border-color: #1d4ed8;
    }

.btn-outline-primary {
    border-radius: 999px;
}

/* Hero chart card */
.hero-chartcard-valu {
    background-color: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem 0.85rem;
    border: 1px solid #d4ddeb;
    box-shadow: 0 10px 24px rgba(15,23,42,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.78rem;
}

/* Admin layout */
.admin-theme {
    background-color: #f1f5f9;
}

.admin-header {
    background-color: #ffffff;
}

.admin-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #0f172a;
}

.admin-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #ffffff;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.admin-brand-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.admin-header-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.admin-header-link {
    color: #2563eb;
    font-weight: 500;
}

.admin-header-link:hover {
    color: #1d4ed8;
}

/* Top Navigation Menu */
.admin-top-nav {
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.admin-top-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.admin-top-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.admin-top-nav-link i {
    font-size: 1.2rem;
}

.admin-top-nav-link:hover {
    color: #2563eb;
    background-color: rgba(37, 99, 235, 0.05);
    text-decoration: none;
}

.admin-top-nav-link.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.admin-shell {
    display: flex;
    min-height: calc(100vh - 200px);
}

.admin-sidebar {
    width: 260px;
    background-color: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 2rem 1.5rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: #334155;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.admin-nav-link i {
    font-size: 0.9rem;
    width: 20px;
    flex-shrink: 0;
}

.admin-nav-link:hover {
    background-color: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.admin-nav-link.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.admin-content {
    flex: 1;
    padding: 2.5rem 3rem;
}

.admin-content .import-api-page {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-footer {
    background-color: #ffffff;
}

.admin-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    color: #64748b;
    font-size: 0.85rem;
}

.admin-footer-links {
    display: flex;
    gap: 1.25rem;
}

.admin-footer a {
    color: #2563eb;
}

.admin-footer a:hover {
    color: #1d4ed8;
}

@media (max-width: 992px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 1.5rem 1.25rem;
    }

    .admin-content {
        padding: 2rem 1.25rem;
    }

    .admin-top-nav-container {
        padding: 0 1rem;
    }
}

/* Admin Page Components */
.admin-page {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-page .container {
    max-width: 100%;
    padding: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.page-header .button-primary,
.page-header .button-secondary {
    margin-left: 0.5rem;
}

/* Admin Buttons */
.button-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.button-primary:hover {
    background-color: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: #ffffff;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-secondary:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
}

.button-small {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.button-small:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    text-decoration: none;
    border-color: #94a3b8;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table thead {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.admin-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.15s ease;
}

.admin-table tbody tr:hover {
    background-color: #f8fafc;
}

.admin-table tbody tr.clickable-row {
    cursor: pointer;
}

.admin-table tbody tr.clickable-row:hover {
    background-color: #eff6ff;
}

.admin-table td {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: #334155;
}

.admin-table td.actions {
    white-space: nowrap;
    text-align: right;
}

.admin-table td.actions > * {
    margin-left: 0.5rem;
}

.admin-table td.actions > *:first-child {
    margin-left: 0;
}

/* Filter Section */
.filters, .filter-section {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.filter-row input[type="text"],
.filter-row select,
.filter-section select,
.filter-section input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #334155;
    transition: border-color 0.15s ease;
}

.filter-row input[type="text"]:focus,
.filter-row select:focus,
.filter-section select:focus,
.filter-section input[type="text"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #334155;
    cursor: pointer;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Cards and Grid Layouts */
.positions-grid,
.coalitions-admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.position-admin-card,
.coalition-admin-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.position-admin-card:hover,
.coalition-admin-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.position-admin-card header h3,
.coalition-admin-card header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.position-admin-card footer,
.coalition-admin-card footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-table {
        font-size: 0.8125rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 1rem;
    }

    .positions-grid,
    .coalitions-admin-list {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 6px;
    white-space: nowrap;
}

.bg-primary {
    background-color: #2563eb;
    color: #ffffff;
}

.bg-success {
    background-color: #16a34a;
    color: #ffffff;
}

.bg-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.bg-info {
    background-color: #0891b2;
    color: #ffffff;
}

.bg-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.chartcard-header-valu {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}

.chartcard-label-valu {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.chartcard-title-valu {
    font-size: 0.86rem;
    color: #111827;
    font-weight: 500;
}

.chart-legend-valu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    font-size: 0.68rem;
    color: #6b7280;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 4px;
}

.legend-blue {
    background-color: #2563eb;
}

.legend-navy {
    background-color: #1e3a8a;
}

.legend-gray {
    background-color: #9ca3af;
}

.chart-bars-valu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-row {
    display: grid;
    grid-template-columns: minmax(140px, auto) 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.chart-bar-row:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chart-bar-row.subtle .chart-label {
    color: #9ca3af;
}

.chart-label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar {
    position: relative;
    height: 28px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-fill {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    transition: width 0.5s ease-in-out;
}

.chart-fill-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.fill-blue {
    background: linear-gradient(to right, #EE1C25, #c81820);
}

.fill-navy {
    background: linear-gradient(to right, #0066CC, #004c99);
}

.fill-amber {
    background: linear-gradient(to right, #DDDD00, #b8b800);
}

.fill-red {
    background: linear-gradient(to right, #AF0000, #8a0000);
}

.fill-green {
    background: linear-gradient(to right, #009933, #007326);
}

.fill-indigo {
    background: linear-gradient(to right, #000077, #000055);
}

.fill-cyan {
    background: linear-gradient(to right, #006EB3, #005289);
}

.fill-emerald {
    background: linear-gradient(to right, #83CF39, #6aab2d);
}

.fill-gray {
    background: linear-gradient(to right, #9ca3af, #6b7280);
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.95) !important;
}

.chart-value {
    font-size: 0.9rem;
    color: #111827;
    font-weight: 600;
    min-width: 55px;
    text-align: right;
}

.chartcard-footnote-valu {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Partikort */
.partycard-valu {
    display: flex;
    flex-direction: column; /* Changed to column for better structure */
    gap: 0.35rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    transition: none;
    text-decoration: none;
    color: var(--text-color);
    min-height: 0;
    height: auto;
}

    .partycard-valu:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        border-color: var(--primary-color);
        transform: none;
    }

.party-logo-wrapper-valu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 0 0.25rem 0.25rem;
}
.party-logo-valu {
    object-fit: contain;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
}
.party-initial-fallback-valu {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eee;
    font-weight: 600;
    font-size: 1rem;
    align-items: center;
    justify-content: center;
    display: none;
}
.party-initial-valu {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: #e0ebff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: #1d4ed8;
    font-weight: 600;
}

.party-body-valu {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.party-name-valu {
    font-size: 0.92rem;
    font-weight: 500;
}

.party-meta-valu {
    font-size: 0.72rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .partycard-valu {
        padding: 0.65rem;
        gap: 0.45rem;
    }

    .party-logo-wrapper-valu {
        width: 40px;
        height: 40px;
        margin: 0 0 0.3rem 0.35rem;
    }

    .party-logo-valu,
    .party-initial-fallback-valu {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .party-name-valu {
        font-size: 0.9rem;
    }

    .party-meta-valu {
        font-size: 0.68rem;
    }
}

/* Info cards */
.infocard-valu {
    background-color: var(--surface-color);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color-light);
    transition: all 0.2s ease-in-out;
}

    .infocard-valu h3 {
        font-family: var(--font-heading);
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-color);
        margin: 0;
    }

    .infocard-valu:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-color: var(--primary-color);
    }

/* Footer */
.footer-valu {
    background-color: transparent; /* Remove white background */
    padding: 1.5rem 0;
    font-size: 0.85rem;
}

.footer-link-valu {
    color: var(--text-color-light);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

    .footer-link-valu:hover {
        color: var(--primary-color);
        text-decoration: underline;
    }


/* Page structure */
.page-header-valu {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.page-kicker-valu {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background-color: #e0ebff;
    color: #1d4ed8;
}

.page-title-valu {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.page-lead-valu {
    color: #4b5563;
    font-size: 0.98rem;
    max-width: 720px;
    margin: 0;
}

.surface-card-valu {
    background-color: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

.link-arrow-valu {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
}

.link-arrow-valu::after {
    content: "\2197";
    font-size: 0.85em;
}

.link-arrow-valu:hover {
    color: #1d4ed8;
}

.page-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.5rem;
}

.no-results-valu {
    padding: 1.25rem 1.5rem;
    background-color: #f1f5f9;
    border-radius: 14px;
    border: 1px dashed #cbd5f5;
    color: #475569;
}

.empty-state-valu {
    padding: 2rem;
    border-radius: 18px;
    border: 1px solid #dbe1f5;
    background: linear-gradient(135deg, #f8fbff, #eef3ff);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    margin-bottom: 2rem;
}

/* Filter panels */
.filter-panel-valu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-panel-valu .form-label {
    margin-bottom: 0.25rem;
}

.filter-panel-valu .form-select {
    min-width: 220px;
}

.filter-checkbox-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.checkbox-chip-valu {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #d5def5;
    background-color: #f5f7ff;
    font-size: 0.85rem;
    transition: all .15s ease;
}

.checkbox-chip-valu:hover {
    border-color: #a5b4fc;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12);
}

.checkbox-chip-valu input {
    accent-color: #2563eb;
    margin-right: 0.35rem;
}

.checkbox-label-valu {
    font-weight: 600;
    font-size: 0.82rem;
}

.checkbox-name-valu {
    font-size: 0.8rem;
    color: #64748b;
}

/* Party cards */
.party-card-valu {
    min-height: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.party-card-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 92px; /* adjust if you need taller/shorter header */
}

.party-card-head-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 64px; /* Reserve room for title + one-line or two-line subtitle */
}

/* Limit subtitle to two lines so long texts don't increase header height */
.party-card-subtitle {
    margin: 0.1rem 0 0 0;
    color: #6b7280;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Slightly larger header on very small screens */
@media (max-width: 576px) {
    .party-card-head {
        min-height: 104px;
    }
}

.party-chip-valu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background-color: rgba(37, 99, 235, 0.08);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.party-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.party-logo-round {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: contain;
    background-color: #fff;
    border: 1px solid #e5e7eb;
}

.party-chip-fallback {
    width: 48px;
    height: 48px;
    font-size: 0.72rem;
}

.party-card-title-valu {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.party-card-valu .party-meta-valu {
    display: grid;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.party-card-valu .party-meta-valu div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.party-card-valu .party-meta-valu dt {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    margin: 0;
}

.party-card-valu .party-meta-valu dd {
    margin: 0;
    font-weight: 500;
    color: #1f2937;
}

.party-card-description {
    margin: 0;
    color: #4b5563;
    font-size: 0.86rem;
}

.party-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Slightly larger on small screens if desired */
@media (max-width: 576px) {
    .party-card-head-body {
        min-height: 72px;
    }
}

/* Fact box */
.fact-box-valu {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.fact-list-valu {
    display: grid;
    gap: 0.75rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    font-size: 0.86rem;
}

.fact-list-valu dt {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0;
}

.fact-list-valu dd {
    margin: 0;
    color: #111827;
    font-weight: 500;
    word-break: break-word;
}

.party-section-valu {
    margin-bottom: 1.5rem;
}

.section-title-valu {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.section-body-valu {
    color: #4b5563;
    font-size: 0.95rem;
}

.leaders-grid-valu {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.leader-card-valu {
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.leader-card-valu h3 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.leader-period-valu {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.results-table-valu {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.results-table-valu th,
.results-table-valu td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #e2e8f0;
}

.results-table-valu th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.timeline-list-valu {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item-valu {
    display: flex;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.timeline-item-valu:last-child {
    border-bottom: none;
}

.timeline-item-valu time {
    font-weight: 600;
    color: #1d4ed8;
    min-width: 48px;
}

.timeline-item-valu h3 {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
}

.timeline-item-valu p {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
}

.coalition-list-valu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.party-footer-valu {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.update-info-valu {
    margin: 0;
    color: #6b7280;
    font-size: 0.82rem;
}

/* Position cards */
.party-positions-valu .surface-card-valu,
.position-card-valu {
    border-left: 4px solid #2563eb;
}

.position-card-valu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-left-color: inherit;
}

.position-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.position-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.position-card-summary {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
}

.position-card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.position-updated-valu {
    color: #94a3b8;
}

/* Coalition simulator */
.coalition-panel-valu {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.coalition-form-valu {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.coalition-form-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.result-card-valu {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
    transition: all 0.2s ease;
}

.result-label-valu {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.result-value-valu {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
}

.result-card-valu.result-majority {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.result-card-valu.result-minority {
    background-color: #fef2f2;
    border-color: #f87171;
}

.coalition-table-valu {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.coalition-table-valu th,
.coalition-table-valu td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
}

.coalition-table-valu th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.coalition-card-valu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.coalition-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
}

.coalition-card-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.coalition-meta-valu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.coalition-total-seats {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.coalition-year-valu {
    font-size: 0.82rem;
    color: #64748b;
}

.coalition-members-valu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.coalition-members-valu li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.coalition-member-name-valu {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.mandate-badge-valu {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.coalition-block-left {
    background-color: #fff1f2;
    border-color: #fecdd3;
}

.coalition-block-left .mandate-badge-valu {
    background-color: rgba(185, 28, 28, 0.12);
    color: #7f1d1d;
}

.coalition-block-right {
    background-color: #eff6ff;
    border-color: #dbeafe;
}

.coalition-block-right .mandate-badge-valu {
    background-color: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.role-badge-valu {
    font-size: 0.75rem;
    color: #6b7280;
}

.disclaimer-valu {
    font-size: 0.88rem;
    color: #475569;
}

/* Content sections */
.content-section-valu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.principles-list-valu {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.source-section-valu {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.source-card-valu {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background-color: #f8fafc;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 1.1rem 1.2rem;
}

.source-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.source-card-url {
    margin: 0;
    font-size: 0.85rem;
    word-break: break-word;
}

.source-card-meta {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.methodology-note-valu {
    font-size: 0.92rem;
    color: #475569;
}

/* Compare page */
.compare-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.compare-page .surface-card-valu {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.party-selector .form-label,
.party-selector h2 {
    margin-bottom: 0.35rem;
}

.party-selector .form-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.party-summary .summary-grid,
.stance-section .stance-grid,
.party-overview .overview-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.summary-tile,
.overview-card,
.stance-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    background-color: #f8fafc;
}

.data-table,
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td,
.comparison-table th,
.comparison-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #e2e8f0;
}

.chart-container,
.map-placeholder,
.simulator-placeholder {
    height: 220px;
    border: 1px dashed #cbd5f5;
    border-radius: 16px;
    background: repeating-linear-gradient(135deg, #f8fbff, #f8fbff 10px, #eef3ff 10px, #eef3ff 20px);
}

.voter-guide .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    border: 1px solid #2563eb;
    color: #2563eb;
    font-weight: 500;
}

.voter-guide .button:hover {
    background-color: #2563eb;
    color: #ffffff;
}

@media (max-width: 767px) {
    .surface-card-valu {
        padding: 1.25rem;
    }

    .result-card-valu {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}


.position-chip-valu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background-color: rgba(37, 99, 235, 0.08);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.party-header-valu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.party-header-valu .page-title-valu {
    margin-bottom: 0;
}


.section-subtitle-valu {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 0.75rem 0;
}

.party-logo-wrapper-lg {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e2e2;
    overflow: hidden;
}
.party-logo-lg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.party-logo-fallback-lg {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.5rem;
    background: #f3f3f3;
    color: #333;
    border-radius: 12px;
}
@media (max-width: 576px) {
    .party-logo-wrapper-lg {
        width:72px;
        height:72px;
    }
    .party-logo-fallback-lg {
        width:72px;
        height:72px;
        font-size:1.25rem;
    }
}

/* Parti logotyper */
.party-logo-stack{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:.5rem;
}
.party-logo-small{
    width:48px;
    height:48px;
    object-fit:contain;
    border-radius:8px;
    background:#fff;
    border:1px solid #e2e2e2;
}
.party-logo-large{
    max-width:200px;   /* Anpassad för dina 200*xxx PNG:er */
    height:auto;
    display:block;
}
.party-logo-fallback{
    width:200px;
    min-height:60px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
    font-size:1.25rem;
    background:#f3f3f3;
    border:1px solid #e2e2e2;
    border-radius:8px;
    color:#333;
}
@media (max-width:768px){
    .party-logo-large{max-width:160px;}
    .party-logo-fallback{width:160px;}
}


.badge-youth-valu {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-youth-valu::before {
    content: "★";
    font-size: 0.7rem;
}

.badge-youth-primary {
    background-color: #dcfce7;
    color: #047857;
}

.chart-card-valu {
    position: relative;
    min-height: 320px;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-card-valu canvas {
    width: 100%;
}

.history-table-wrapper {
    min-width: 260px;
    max-width: 320px;
}

.section-footnote-valu {
    font-size: 0.78rem;
}

.poll-list-valu {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.poll-item-valu {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.poll-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}

.poll-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.poll-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #111827;
}

.poll-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

@media (max-width: 992px) {
    .history-table-wrapper {
        width: 100%;
        max-width: none;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .chart-card-valu {
        min-height: 280px;
    }
    
    .metric-card-valu {
        padding: 1rem;
    }
    
    .metric-value-valu {
        font-size: 1.5rem;
    }
}

/* Coalition builder drag and drop styles */
.coalition-zone-valu {
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
}

.party-drag-zone {
    min-height: 120px;
    padding: 1rem;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    background-color: #ffffff;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.party-drag-zone.drag-over {
    border-color: #2563eb;
    background-color: #eff6ff;
}

.coalition-drop-zone {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

.coalition-drop-zone.drag-over {
    border-color: #16a34a;
    background-color: #dcfce7;
}

.draggable-party {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: all 0.15s ease;
    user-select: none;
}

.draggable-party:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.draggable-party.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.draggable-party.in-coalition {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.drag-party-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
}

.drag-party-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.drag-party-seats {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: auto;
}

/* Seat bar visualization */
.seat-bar-container {
    padding: 0 0.5rem;
}

.seat-bar {
    position: relative;
    height: 24px;
    background-color: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.seat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f87171, #ef4444);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.seat-bar-fill.majority {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.seat-bar-majority {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #0f172a;
}

.seat-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #6b7280;
}

.majority-label {
    position: relative;
    left: 0;
    transform: translateX(-50%);
}


@media (max-width: 768px) {
    .draggable-party {
        padding: 0.4rem 0.65rem;
    }
    
    .drag-party-logo {
        width: 24px;
        height: 24px;
    }
    
    .drag-party-name {
        font-size: 0.82rem;
    }
    
    .drag-party-seats {
        font-size: 0.7rem;
    }
}

/* Riksdagen education page styles */
.fact-card-riksdag {
    background: linear-gradient(135deg, #f8fbff, #eef3ff);
    border: 1px solid #d5def5;
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    height: 100%;
}

.fact-value-riksdag {
    font-size: 2rem;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1.2;
}

.fact-label-riksdag {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    margin-top: 0.25rem;
}

.fact-desc-riksdag {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

.info-box-riksdag {
    background-color: #f0f9ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 1rem 0;
}

.info-box-riksdag h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1d4ed8;
    margin: 0 0 0.5rem 0;
}

.info-box-riksdag p,
.info-box-riksdag ul {
    margin: 0;
    color: #374151;
}

.info-box-riksdag ul {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.info-box-riksdag li {
    margin-bottom: 0.35rem;
}

.info-box-important {
    background-color: #fef3c7;
    border-left-color: #d97706;
}

.info-box-important h3 {
    color: #b45309;
}

.tip-card-riksdag {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
}

.tip-card-riksdag h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.tip-card-riksdag p {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

.pros-cons-card-riksdag {
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
}

.pros-cons-card-riksdag h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.pros-cons-card-riksdag ul {
    margin: 0;
    padding-left: 1.25rem;
}

.pros-cons-card-riksdag li {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.pros-card {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
}

.pros-card h3 {
    color: #166534;
}

.cons-card {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
}

.cons-card h3 {
    color: #991b1b;
}

/* Coalition tabs styling */
.coalition-tabs-valu {
    border-bottom: 2px solid #e2e8f0;
}

.coalition-tabs-valu .nav-item {
    margin-bottom: -2px;
}

.coalition-tab-valu {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #64748b;
    background-color: transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coalition-tab-valu:hover {
    color: #2563eb;
    background-color: #f1f5f9;
}

.coalition-tab-valu.active {
    color: #2563eb;
    background-color: #eff6ff;
    border-bottom-color: #2563eb;
}

.coalition-tab-valu .tab-icon {
    font-size: 1.1rem;
}

.coalition-tab-content-valu {
    padding: 1rem 0;
}

.coalition-tab-content-valu .tab-pane {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.coalition-active-badge-valu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Coalition info cards - reference and dynamic */
.coalition-info-card-valu {
    border-left: 4px solid #2563eb;
}

.coalition-reference-card {
    border-left-color: #6366f1;
    background: linear-gradient(135deg, #f8fbff, #eef3ff);
}

.coalition-dynamic-card {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.coalition-info-list li:last-child {
    border-bottom: none !important;
}

.coalition-active-source-card {
    border: 1px solid #dfe7f5;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    border-radius: 16px;
}

.coalition-active-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Responsive adjustments for coalition tabs */
@media (max-width: 576px) {
    .coalition-tab-valu {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .coalition-tab-valu .tab-icon {
        font-size: 1rem;
    }

    .coalition-tabs-valu {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

/* Clickable party card wrapper */
.party-card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.party-card-link-wrapper:hover {
    text-decoration: none;
    color: inherit;
}

.party-card-link-wrapper:hover .party-card-valu {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.party-card-link-wrapper:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 12px;
}

.party-card-link-wrapper .party-card-valu {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.party-card-footer .link-arrow-valu {
    pointer-events: none;
}

/* Metric cards for party statistics */
.metric-card-valu {
    background: linear-gradient(135deg, #f8fbff, #eef3ff);
    border: 1px solid #d5def5;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    transition: all 0.2s ease;
}

.metric-card-valu:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.metric-label-valu {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-weight: 600;
}

.metric-value-valu {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1.2;
}

.metric-subtext-valu {
    font-size: 0.8rem;
    color: #64748b;
}

.metric-card-valu.metric-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}

.metric-card-valu.metric-success .metric-value-valu {
    color: #16a34a;
}

.metric-card-valu.metric-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fcd34d;
}

.metric-card-valu.metric-warning .metric-value-valu {
    color: #d97706;
}

/* Consent banner */
.consent-banner {
    position: fixed;
    bottom: 1.5rem;
    right: 1.25rem;
    left: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    z-index: 1100;
    display: none;
}

.consent-banner.is-visible {
    display: block;
}

.consent-banner__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.consent-banner__text p {
    color: var(--text-color-light);
}

.consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.consent-banner__link a {
    font-weight: 600;
    text-decoration: underline;
}

@media (min-width: 768px) {
    .consent-banner {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 720px;
    }

    .consent-banner__content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .consent-banner__text {
        max-width: 70%;
    }
}
/* Grundkort */
.ov-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #dde1e7;
    padding: 1.5rem 1.75rem;
}

.ov-card--soft {
    background-color: #f9fafb;
}

.ov-card--accent {
    background: linear-gradient(135deg, #f1f5ff, #ffffff);
    border-color: #c5d1f2;
}

.ov-card-kicker {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    color: #7a8699;
    margin-bottom: .25rem;
}

.ov-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: .75rem;
}

.ov-card-title-sm {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Ikoner i kort */
.ov-card-icon {
    font-size: 1.8rem;
    margin-bottom: .5rem;
}

/* Grid 3-kolumners */
.ov-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

/* KPI-listor i sidokolumn */
.ov-kpi-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

    .ov-kpi-list li {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: .35rem 0;
        border-bottom: 1px dashed #e0e4ef;
        font-size: .9rem;
    }

        .ov-kpi-list li:last-child {
            border-bottom: none;
        }

    .ov-kpi-list span {
        color: #6b7280;
    }

    .ov-kpi-list strong {
        font-weight: 600;
        color: #111827;
    }

/* ==========================================================================
   Lazy Loading & Performance
   ========================================================================== */

/* Lazy loading for images */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* Skeleton loader for lazy images */
.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimize chart containers */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Sticky navigation for long pages */
.sticky-subnav {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
}

/* Content width optimization for readability */
.content-readable {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    padding: 0 0.5rem;
    color: #6b7280;
}

.breadcrumb-item a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6b7280;
}

/* Related content hover effects */
.hover-lift {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.ad-slot {
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.75rem 0.9rem;
}

.ad-slot__label {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.ad-slot__body {
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 0.65rem;
    padding: 0.65rem;
}

.ad-slot__placeholder {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.ad-slot[aria-label] {
    display: block;
}

/* ==========================================
   CMS Content Blocks
   ========================================== */

.cms-content-block {
    margin: 1.5rem 0;
}

.cms-content-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.cms-content-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.cms-content-body h1,
.cms-content-body h2,
.cms-content-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.cms-content-body h1 {
    font-size: 1.75rem;
}

.cms-content-body h2 {
    font-size: 1.5rem;
}

.cms-content-body h3 {
    font-size: 1.25rem;
}

.cms-content-body p {
    margin-bottom: 1rem;
}

.cms-content-body ul,
.cms-content-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.cms-content-body li {
    margin-bottom: 0.5rem;
}

.cms-content-body a {
    color: var(--accent-color);
    text-decoration: underline;
}

.cms-content-body a:hover {
    color: var(--secondary-color);
}

.cms-content-body strong {
    font-weight: 600;
}

.cms-content-body em {
    font-style: italic;
}

.cms-content-body code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9em;
}

.cms-content-body blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-color-light);
    font-style: italic;
}
