:root {
    --theme-border: none;
    --theme-transition: all 0.12s cubic-bezier(0.455, 0.03, 0.515, 0.955);
    --theme-list-indent: 2.5em;
    --true: initial;
    --false: "";
    --has-link-decoration: var(--true);
    --has-transparent-header: 0;
    --theme-container-width: min(100%, var(--theme-container-width-base));
    --theme-container-width-base: calc(var(--theme-container-edge-spacing, 90vw) - var(--theme-frame-size, 0px) * 2);
    --theme-font-stack-default: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --rankmath-wp-adminbar-height: 0;
    --swiper-navigation-size: 44px;
    --swiper-theme-color: #007aff;
    --wp--style--block-gap: var(--theme-content-spacing, 1.5em);
    --wp--style--global--content-size: var(--theme-block-max-width, 1200px);
    --wp--style--global--wide-size: var(--theme-block-wide-max-width, 1400px);

    --wp--preset--aspect-ratio--square: 1;
    --wp--preset--aspect-ratio--4-3: 4 / 3;
    --wp--preset--aspect-ratio--3-4: 3 / 4;
    --wp--preset--aspect-ratio--3-2: 3 / 2;
    --wp--preset--aspect-ratio--2-3: 2 / 3;
    --wp--preset--aspect-ratio--16-9: 16 / 9;
    --wp--preset--aspect-ratio--9-16: 9 / 16;
    --wp--preset--color--black: #000000;
    --wp--preset--color--cyan-bluish-gray: #abb8c3;
    --wp--preset--color--white: #ffffff;
    --wp--preset--color--pale-pink: #f78da7;
    --wp--preset--color--vivid-red: #cf2e2e;
    --wp--preset--color--luminous-vivid-orange: #ff6900;
    --wp--preset--color--luminous-vivid-amber: #fcb900;
    --wp--preset--color--light-green-cyan: #7bdcb5;
    --wp--preset--color--vivid-green-cyan: #00d084;
    --wp--preset--color--pale-cyan-blue: #8ed1fc;
    --wp--preset--color--vivid-cyan-blue: #0693e3;
    --wp--preset--color--vivid-purple: #9b51e0;
    --wp--preset--color--palette-color-1: var(--theme-palette-color-1, #076951);
    --wp--preset--color--palette-color-2: var(--theme-palette-color-2, #16876b);
    --wp--preset--color--palette-color-3: var(--theme-palette-color-3, #365951);
    --wp--preset--color--palette-color-4: var(--theme-palette-color-4, #192c27);
    --wp--preset--color--palette-color-5: var(--theme-palette-color-5, #E7F4F1);
    --wp--preset--color--palette-color-6: var(--theme-palette-color-6, #F2F7F6);
    --wp--preset--color--palette-color-7: var(--theme-palette-color-7, #f8fafa);
    --wp--preset--color--palette-color-8: var(--theme-palette-color-8, #ffffff);

    --theme-font-family: 'IBM Plex Sans Arabic', Sans-Serif;
    --theme-font-weight: 400;
    --theme-text-transform: none;
    --theme-text-decoration: none;
    --theme-font-size: 22px;
    --theme-line-height: 1.65;
    --theme-letter-spacing: 0em;
    --theme-button-font-weight: 500;
    --theme-button-font-size: 15px;
    --has-classic-forms: var(--true);
    --has-modern-forms: var(--false);
    --theme-form-field-height: 45px;
    --theme-form-field-border-radius: 10px;
    --theme-form-field-border-initial-color: var(--theme-border-color);
    --theme-form-field-border-focus-color: var(--theme-palette-color-1);
    --theme-form-field-border-width: 2px;
    --theme-form-selection-field-initial-color: var(--theme-border-color);
    --theme-form-selection-field-active-color: var(--theme-palette-color-1);
    --theme-palette-color-1: #076951;
    --theme-palette-color-2: #16876b;
    --theme-palette-color-3: #365951;
    --theme-palette-color-4: #192c27;
    --theme-palette-color-5: #E7F4F1;
    --theme-palette-color-6: #F2F7F6;
    --theme-palette-color-7: #f8fafa;
    --theme-palette-color-8: #ffffff;
    --theme-text-color: var(--theme-palette-color-3);
    --theme-link-initial-color: var(--theme-palette-color-1);
    --theme-link-hover-color: var(--theme-palette-color-2);
    --theme-selection-text-color: #ffffff;
    --theme-selection-background-color: var(--theme-palette-color-1);
    --theme-border-color: var(--theme-palette-color-5);
    --theme-headings-color: var(--theme-palette-color-4);
    --theme-content-spacing: 1.5em;
    --theme-button-min-height: 40px;
    --theme-button-shadow: none;
    --theme-button-transform: none;
    --theme-button-text-initial-color: #ffffff;
    --theme-button-text-hover-color: #ffffff;
    --theme-button-background-initial-color: var(--theme-palette-color-1);
    --theme-button-background-hover-color: var(--theme-palette-color-2);
    --theme-button-border: none;
    --theme-button-border-radius: 8px;
    --theme-button-padding: 5px 20px;
    --theme-normal-container-max-width: 1290px;
    --theme-content-vertical-spacing: 60px;
    --theme-container-edge-spacing: 90vw;
    --theme-narrow-container-max-width: 750px;
    --theme-wide-offset: 130px;

    /* Plugin Design Tokens mapped to Theme Palette */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 161 88% 22%; /* mapped to #076951 */
    --primary-foreground: 0 0% 100%;
    --secondary: 164 29% 93%; /* mapped to #E7F4F1 */
    --secondary-foreground: 164 25% 13%;
    --muted: 165 25% 96%; /* mapped to #F2F7F6 */
    --muted-foreground: 164 25% 28%;
    --accent: 164 29% 93%;
    --accent-foreground: 161 88% 22%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 164 29% 90%;
    --input: 164 29% 90%;
    --ring: 161 88% 22%;
    --radius: 0.5rem;
}

/* Base resets & typography for Parliament container */
.parliament-container * {
    font-family: inherit;
    box-sizing: border-box;
}

.parliament-container {
    font-family: inherit;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    width: 100%;
    margin: 0 auto;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.parliament-container[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.parliament-container[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.parliament-container[dir="ltr"] .parliament-main-grid {
    direction: ltr;
}

.parliament-container[dir="ltr"] .parliament-canvas-column {
    order: 1;
}

.parliament-container[dir="ltr"] .parliament-sidebar-column {
    order: 2;
}

.parliament-container[dir="rtl"] .parliament-main-grid {
    direction: rtl;
}

.parliament-container[dir="rtl"] .parliament-canvas-column {
    order: 1;
}

.parliament-container[dir="rtl"] .parliament-sidebar-column {
    order: 2;
}

body.parliament-embed-wrapper,
body.parliament-embed-wrapper * {
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Canvas Visualization */
#parliament-canvas {
    cursor: pointer;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

#parliament-canvas.is-zoomed {
    cursor: default;
}

/* shadcn-inspired button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    outline: none;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-primary:hover {
    background-color: hsl(142.1 76.2% 31%);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(240 4.8% 90%);
}

.btn-secondary.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

.btn-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--input));
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
    background-color: hsl(0 84.2% 52%);
}

/* shadcn-inspired card */
.card {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 4px);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
    transition: box-shadow 0.2s ease-in-out;
}

/* shadcn-inspired input */
.input {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: hsl(var(--foreground));
    transition: all 0.15s ease-in-out;
    outline: none;
}

.input.pr-10 {
    padding-right: 2.5rem !important;
}

.input.pl-10 {
    padding-left: 2.5rem !important;
}

.parliament-container[dir="rtl"] .search-input-wrapper input {
    padding-right: 2.5rem !important;
    padding-left: 0.75rem !important;
}

.parliament-container[dir="ltr"] .search-input-wrapper input {
    padding-left: 2.5rem !important;
    padding-right: 0.75rem !important;
}

.parliament-container[dir="rtl"] .search-icon-wrapper {
    right: 0;
    left: auto;
    padding-right: 0.75rem;
    padding-left: 0;
}

.parliament-container[dir="ltr"] .search-icon-wrapper {
    left: 0;
    right: auto;
    padding-left: 0.75rem;
    padding-right: 0;
}

.input:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

/* shadcn-inspired select */
.select {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--input));
    background-color: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: hsl(var(--foreground));
    transition: all 0.15s ease-in-out;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-left: 2.25rem;
}

.select:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* shadcn-inspired badge */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
}

.badge-default {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.badge-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border-color: hsl(var(--border));
}

.badge-outline {
    background-color: transparent;
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

/* shadcn-inspired switch */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 1.5rem;
    width: 2.75rem;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 9999px;
    border: 2px solid transparent;
    transition: background-color 0.2s ease-in-out;
    background-color: hsl(var(--input));
}

.switch[data-state="checked"] {
    background-color: hsl(var(--primary));
}

.switch-thumb {
    pointer-events: none;
    display: block;
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 9999px;
    background-color: hsl(var(--background));
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.15);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    left: 0.125rem;
}

.switch[data-state="checked"] .switch-thumb {
    left: 1.375rem;
}

/* RTL switch handling */
[dir="rtl"] .switch-thumb {
    left: auto;
    right: 0.125rem;
}

[dir="rtl"] .switch[data-state="checked"] .switch-thumb {
    right: 1.375rem;
}

/* shadcn-inspired dialog/modal */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgb(0 0 0 / 0.5);
    animation: fadeIn 0.2s ease-out;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.dialog-content {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 50;
    display: grid;
    width: 95%;
    max-width: 56rem;
    transform: translate(-50%, -50%);
    gap: 1rem;
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    border-radius: calc(var(--radius) + 6px);
    animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dialog-overlay,
    .dialog-content {
        animation: none;
    }
}

/* Search results dropdown */
.search-results {
    position: absolute;
    z-index: 50;
    margin-top: 0.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--popover));
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    max-height: 20rem;
    overflow-y: auto;
}

#mobile-search-results {
    position: relative;
    z-index: 60;
    max-height: 15rem;
    margin-top: 0.5rem;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid hsl(var(--border));
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: hsl(var(--accent));
}

/* Canvas Tooltip */
#tooltip {
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    background-color: hsl(240 10% 3.9%);
    color: hsl(0 0% 100%);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
}

/* Mobile Button Tooltips */
.mobile-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background-color: hsl(240 10% 3.9%);
    color: hsl(0 0% 100%);
    border-radius: var(--radius);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 10;
    pointer-events: none;
}

.mobile-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: hsl(240 10% 3.9%);
}

.mobile-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.mobile-buttons-container {
    position: relative;
}

#mobile-search-tooltip {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

#mobile-filter-tooltip {
    top: 100%;
    margin-top: 0.5rem;
}

#mobile-search-tooltip::before {
    top: 100%;
    bottom: auto;
    border-top-color: hsl(240 10% 3.9%);
    border-bottom-color: transparent;
}

/* Stats bar */
.stat-bar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: calc(var(--radius) - 2px);
}

/* Legend item */
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    background-color: hsl(var(--muted));
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.legend-item:hover {
    background-color: hsl(var(--secondary));
}

.legend-item:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.legend-item.is-active {
    background-color: hsl(var(--secondary));
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25);
}

.legend-color {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Loading spinner */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid hsl(var(--muted));
    border-top-color: hsl(var(--primary));
    border-radius: 9999px;
    animation: spin 0.8s linear infinite;
}

.separator {
    height: 1px;
    width: 100%;
    background-color: hsl(var(--border));
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--muted));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--muted-foreground) / 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground) / 0.5);
}

.modal-text-content {
    white-space: pre-line;
    word-wrap: break-word;
}

#parliament-canvas:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: var(--radius);
}

#parliament-canvas.is-zoomed {
    cursor: zoom-out;
}

/* Counts-only note */
#counts-only-note {
    max-width: 36rem;
    margin-inline: auto;
}

/* Clickable statistics rail */
.stat-row {
    display: block;
    width: 100%;
    text-align: inherit;
    border: none;
    background: transparent;
    padding: 0.75rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background-color 0.15s ease-in-out;
    border-bottom: 1px solid hsl(var(--border));
}

.stat-row:hover {
    background-color: hsl(var(--muted));
}

.stat-row:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.stat-row.is-active {
    background-color: hsl(var(--secondary));
    box-shadow: inset 0 0 0 1px hsl(var(--ring));
}

.stat-row:last-child {
    border-bottom: none;
}

/* Member detail card (Omran-style grouped layout) */
.member-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 46rem;
    margin-inline: auto;
}

@media (min-width: 40rem) {
    .member-card {
        grid-template-columns: 9rem minmax(0, 1fr);
        align-items: start;
    }
}

.member-card-photo-wrap {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.member-card-photo {
    width: 9rem;
    height: 9rem;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted));
    aspect-ratio: 1/1;
}

.member-card-name {
    margin: 0 0 0.25rem;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.4;
    color: hsl(var(--foreground));
    text-wrap: balance;
}

.member-card-name:focus {
    outline: none;
}

.member-card-role {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--primary));
}

.member-card-groups {
    columns: 1;
    column-gap: 2rem;
    margin-top: 1rem;
}

@media (min-width: 64rem) {
    .member-card-groups {
        columns: 2;
    }
}

@media (min-width: 80rem) {
    .member-card-groups {
        columns: 3;
    }
}

.member-card-group {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.member-card-group-title {
    margin: 0 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    color: hsl(var(--primary));
}

.member-card-fields {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 2px 0.75rem;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.member-card-fields dt {
    color: hsl(var(--muted-foreground));
    white-space: nowrap;
}

.member-card-fields dd {
    margin: 0;
    min-inline-size: 0;
    font-weight: 600;
    color: hsl(var(--foreground));
    white-space: pre-line;
    word-wrap: break-word;
}

.member-card-fields dd a {
    color: hsl(var(--primary));
    text-decoration: underline;
}

.member-card-fields dd a:hover {
    text-decoration: none;
}

@media (max-width: 40rem) {
    .member-card-photo {
        width: 7rem;
        height: 7rem;
    }
}

/* Wider dialog on desktop; card fills it, groups stack in rows on
   smaller screens instead of cramming into columns. */
.member-card-dialog {
    max-width: 72rem;
}

.member-card-dialog .member-card {
    max-width: none;
}

/* ==========================================================================
   Parliamentary Committees Filter & UI Styles
   ========================================================================== */
#desktop-filters {
    position: relative;
    z-index: 35;
}

#desktop-filters > .card {
    position: relative;
    overflow: visible;
}

.committee-dropdown-wrap {
    width: 100%;
    position: relative;
    z-index: 40;
}

.committee-dropdown-wrap.is-open {
    z-index: 50;
}

.committee-dropdown-toggle {
    min-height: 40px;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    outline: none;
    font-family: inherit;
}

.committee-dropdown-toggle:hover {
    border-color: hsl(var(--primary) / 0.5);
    background-color: hsl(var(--muted) / 0.3);
}

.committee-dropdown-toggle:focus-visible {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.3);
}

.committee-dropdown-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.committee-dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 0.25rem;
    width: 100%;
    max-height: 320px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    background-color: hsl(var(--card));
    z-index: 50;
    overflow: hidden;
}

.committee-dropdown-menu:not(.hidden) {
    display: flex !important;
    flex-direction: column;
}

.committee-dropdown-options {
    flex: 1 1 auto;
    max-height: 240px;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 0.25rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--muted-foreground) / 0.4) transparent;
}

.committee-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.committee-dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.committee-dropdown-options::-webkit-scrollbar-thumb {
    background-color: hsl(var(--muted-foreground) / 0.4);
    border-radius: 9999px;
}

.committee-dropdown-options::-webkit-scrollbar-thumb:hover {
    background-color: hsl(var(--muted-foreground) / 0.6);
}

.committee-dropdown-search {
    font-family: inherit;
    border-color: hsl(var(--border));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.committee-dropdown-search:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.15);
}

.committee-dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-family: inherit;
    color: hsl(var(--foreground));
    cursor: pointer;
    transition: background-color 0.12s ease;
    border: none;
    background: transparent;
    text-align: start;
    user-select: none;
}

.committee-dropdown-option:hover,
.committee-dropdown-option:focus {
    background-color: hsl(var(--muted));
    color: hsl(var(--foreground));
    outline: none;
}

.committee-dropdown-option.selected {
    background-color: hsl(var(--primary) / 0.1);
    color: hsl(var(--primary));
    font-weight: 600;
}

.committee-dropdown-dot {
    display: inline-block;
    border-radius: 9999px;
    flex-shrink: 0;
}

.committee-dropdown-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

.committee-dropdown-option.selected .committee-dropdown-badge {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* Active Committee Banner */
#active-committee-banner {
    animation: fadeIn 0.2s ease-out;
}

.active-comm-lead-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modal Parliamentary Committees section */
.member-card-committees {
    transition: all 0.15s ease-in-out;
}

.member-comm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.625rem;
    border-radius: calc(var(--radius) - 2px);
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    margin-bottom: 0.375rem;
    gap: 0.5rem;
}

.member-comm-item:last-child {
    margin-bottom: 0;
}

.member-comm-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.member-comm-role {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.member-comm-role.role-chair {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.member-comm-role.role-vice_chair {
    background-color: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.member-comm-role.role-rapporteur {
    background-color: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.member-comm-role.role-member {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
}

.member-comm-btn {
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    background-color: hsl(var(--secondary));
    color: hsl(var(--primary));
    font-weight: 600;
    border: 1px solid hsl(var(--primary) / 0.3);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.member-comm-btn:hover {
    background-color: hsl(var(--primary));
    color: #ffffff;
}

/* Committee members quick-access table (under canvas) */
#committee-members-wrap {
    animation: fadeIn 0.2s ease-out;
}

.committee-members-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--background));
}

.committee-members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.5;
}

.committee-members-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: hsl(var(--muted));
    color: hsl(var(--foreground));
    font-size: 0.75rem;
    font-weight: 700;
    text-align: start;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
    white-space: nowrap;
}

.committee-members-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid hsl(var(--border));
    vertical-align: middle;
}

.committee-members-table tbody tr:last-child td {
    border-bottom: none;
}

.committee-members-table tbody tr:hover {
    background-color: hsl(var(--muted) / 0.5);
}

.committee-members-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted));
    display: block;
}

.committee-members-cell-photo {
    width: 3.5rem;
}

.committee-members-col-num,
.committee-members-cell-num {
    width: 2.5rem;
    text-align: center;
    white-space: nowrap;
    color: hsl(var(--muted-foreground));
    font-variant-numeric: tabular-nums;
}

.committee-members-cell-gov {
    white-space: nowrap;
}

.committee-members-cell-degree {
    min-width: 8rem;
    max-width: 16rem;
}

.committee-members-cell-action {
    width: 4.5rem;
    text-align: end;
}

.committee-members-name-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: hsl(var(--foreground));
    cursor: pointer;
    text-align: start;
}

.committee-members-name-btn:hover {
    color: hsl(var(--primary));
    text-decoration: underline;
}

.committee-members-name-btn:focus-visible,
#committee-members-close:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
    border-radius: 4px;
}

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

@media (max-width: 40rem) {
    .committee-members-scroll {
        max-height: 280px;
    }
    .committee-members-table {
        font-size: 0.8125rem;
    }
    .committee-members-avatar {
        width: 2rem;
        height: 2rem;
    }
}

.btn.hidden, .hidden {
    display: none !important;
}
