:root {
    --bg: #FAFAF8;
    --text: #1A1A1A;
    --accent: #C8102E;
    --border: #E5E5E3;
    --muted: #767676;
    --card-bg: #FFFFFF;
    --shadow-soft: 0 10px 24px rgba(26, 26, 26, 0.05);
    --radius: 14px;
    --container-pad: clamp(0.75rem, 2vw, 1.5rem);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overscroll-behavior: none;
}
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

a {
    color: var(--text);
    text-decoration: none;
}
a:hover {
    color: var(--accent);
}

.kandidattest-red-link,
.kandidattest-red-link:visited,
.kandidattest-red-link:active {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.kandidattest-red-link:hover,
.kandidattest-red-link:focus-visible {
    color: #a20d24;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 var(--container-pad);
    padding-left: max(var(--container-pad), var(--safe-left));
    padding-right: max(var(--container-pad), var(--safe-right));
}

/* ===== Nav ===== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 52px;
    flex-wrap: wrap;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
.nav-content h1 {
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.nav-content h1 a {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-flag {
    width: 20px;
    height: auto;
    flex-shrink: 0;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
    display: none;
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    z-index: 110;
}
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 250ms ease, opacity 180ms ease;
}
.nav-toggle-bar + .nav-toggle-bar {
    margin-top: 5px;
}
.nav-toggle--open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle--open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle--open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Main nav — desktop shows inline, mobile shows as dropdown */
.main-nav {
    display: flex;
    gap: clamp(0.4rem, 1.5vw, 1.5rem);
    flex-wrap: wrap;
    margin-left: auto;
}
.main-nav a {
    font-weight: 600;
    font-size: clamp(0.72rem, 1.5vw, 0.88rem);
    color: var(--muted);
    white-space: nowrap;
}
.main-nav a:hover { color: var(--accent); }

.election-countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid rgba(200, 16, 46, 0.25);
    background: rgba(200, 16, 46, 0.05);
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}
.election-countdown.election-countdown--mobile {
    display: none;
}
.countdown-days {
    color: var(--accent);
    font-size: clamp(0.62rem, 1.2vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.countdown-date {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
}
.site-tagline {
    margin: -0.15rem 0 0;
    padding: 0 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-align: left;
    line-height: 1.4;
}

/* ===== Mobile day nav (visible on small screens) ===== */
.mobile-day-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.mobile-day-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.mobile-day-scroll {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0;
}
.mobile-day-scroll::-webkit-scrollbar { display: none; }
.mobile-day-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 120ms ease;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.mobile-day-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.mobile-day-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== Hero intro (welcome) ===== */
.hero-intro {
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    margin: 1.5rem auto 0;
    max-width: min(720px, 100%);
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(248,248,248,0.7));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.hero-intro h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
}
.hero-intro p {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}
.hero-intro__note {
    font-size: 0.82rem !important;
    color: var(--text-muted, #777) !important;
    margin-top: 0.6rem !important;
}

/* ===== Hero / daily overview ===== */
.hero {
    margin: 1.5rem 0;
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}
.hero h2 {
    margin: 0 0 0.15rem;
}
.daily-overview-updated {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted, #888);
}
.daily-summary {
    font-size: 1rem;
    max-width: min(980px, 100%);
    margin: 0.75rem auto 0;
    color: var(--text);
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(0.85rem, 2vw, 1.2rem);
    box-shadow: var(--shadow-soft);
}

/* Mandate strip under daily overview */
.mandate-strip {
    max-width: min(980px, 100%);
    margin: 0.75rem auto 0;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-soft);
}
.mandate-strip-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.mandate-strip-header h3 {
    margin: 0;
    font-size: 0.85rem;
}
.mandate-strip-blocs {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
}
.mandate-strip-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    gap: 1px;
}
.mandate-strip-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    transition: flex 0.3s;
}
.mandate-strip-segment span {
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.mandate-strip-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.6rem;
    margin-top: 0.4rem;
    justify-content: center;
}
.mandate-strip-label {
    font-size: 0.68rem;
    font-weight: 700;
}
.mandate-strip-source {
    margin: 0.35rem 0 0;
    font-size: 0.62rem;
    color: var(--muted);
    text-align: center;
}

.daily-summary h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.02rem;
    line-height: 1.35;
    text-align: center;
}

.summary-text {
    color: #333;
    font-size: clamp(0.88rem, 1.8vw, 0.95rem);
    line-height: 1.72;
    letter-spacing: 0.002em;
    overflow-wrap: anywhere;
}
.summary-text--panel {
    margin: 0.35rem 0 0;
}
.summary-text--timeline {
    max-width: none;
}
.summary-paragraph {
    margin: 0;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}
.summary-paragraph + .summary-paragraph {
    margin-top: 0.85rem;
}
.summary-day-label {
    margin: 0 0 0.6rem;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}
.summary-day-inline {
    color: #888;
    font-weight: normal;
}
.ai-disclaimer-note {
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.45;
}
.ai-disclaimer-note--center {
    text-align: center;
}
.timeline-hero-lead {
    max-width: min(760px, 100%);
    margin: 0.85rem auto 0;
    text-align: center;
    color: var(--text);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

/* Overview toggle buttons */
.overview-toggles {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}
.toggle-btn {
    padding: 0.5rem 1rem;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}
.toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.toggle-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.toggle-panel {
    max-width: min(980px, 100%);
    margin: 0.8rem auto 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
    text-align: left;
}
.toggle-panel .summary-text {
    margin: 0 auto;
}

/* ===== Left day timeline (desktop only) ===== */
.left-day-timeline {
    display: none;
}

.timeline-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-align: center;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}
.timeline-help {
    font-size: 0.63rem;
    line-height: 1.45;
    color: var(--muted);
    text-align: center;
    margin: 0 0 0.75rem;
    position: relative;
    z-index: 2;
}
.left-day-timeline .timeline-track {
    position: absolute;
    left: 50%;
    top: 64px;
    bottom: 0;
    transform: translateX(-50%);
    width: 1px;
    background: var(--border);
}
.left-day-timeline .timeline-dates {
    position: relative;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    padding: 0.15rem 0;
    pointer-events: auto;
    scrollbar-width: none;
}
.left-day-timeline .timeline-dates::-webkit-scrollbar { display: none; }
.date-circle-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(200, 16, 46, 0.45);
    background: rgba(200, 16, 46, 0.86);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(200, 16, 46, 0.14);
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
    text-decoration: none;
}
.date-circle-btn:hover {
    transform: scale(1.08);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 22px rgba(200, 16, 46, 0.22);
}
.date-circle-btn.active {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.16), 0 12px 24px rgba(200, 16, 46, 0.2);
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.25rem 0 3rem;
}
.timeline-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    padding: 1rem;
}
.timeline-card h3 {
    margin: 0 0 0.4rem 0;
}
.timeline-summary-block {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.timeline-summary-block h4 {
    margin: 0 0 0.45rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ===== Poll page (Målinger) ===== */
.poll-page {
    margin: 1.5rem 0 3rem;
}
.poll-page h2 {
    margin: 0 0 0.15rem;
}
.poll-page-subtitle {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: var(--muted);
}
.poll-page-intro {
    margin: 0.25rem 0 1.5rem;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.55;
    max-width: 700px;
}
.poll-institutes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0 0 1.5rem;
}
.poll-institute-card {
    padding: 1.25rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.poll-institute-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}
.poll-institute-card p {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}
.poll-updated {
    display: block;
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--accent);
}
.poll-institute-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.poll-institute-link:hover {
    text-decoration: underline;
}
/* Institute filter chips */
.poll-firm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
}
.poll-firm-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: #f0f0ee;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.poll-firm-chip:hover {
    border-color: var(--accent);
}
.poll-firm-chip--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.poll-trend-chart-wrap {
    position: relative;
    width: 100%;
    height: 520px;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.poll-data-disclaimer {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    text-align: center;
    line-height: 1.4;
}

/* Poll detail panel (tap-to-show on mobile, replaces tooltip) */
.poll-detail-panel {
    margin-top: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}
.poll-detail-panel--open {
    max-height: 600px;
    opacity: 1;
    padding: 1rem 1.25rem;
}
.poll-detail-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.poll-detail-close:hover {
    color: var(--accent);
}
.poll-detail-inner {
    clear: both;
}

/* Custom HTML hover tooltip (positioned inside chart wrap) */
.poll-hover-tt {
    position: absolute;
    z-index: 50;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    max-width: 280px;
    min-width: 160px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.12s ease;
}
.poll-tt-title {
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 8px;
    font-size: 14px;
}
.poll-tt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 13px;
}
.poll-tt-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.poll-tt-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.poll-tt-val {
    font-weight: 600;
    white-space: nowrap;
}
.poll-tt-up {
    color: #2e7d32;
    font-weight: 600;
    margin-left: 2px;
    font-size: 12px;
}
.poll-tt-down {
    color: #c62828;
    font-weight: 600;
    margin-left: 2px;
    font-size: 12px;
}

/* ===== Grid layout ===== */
.grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feed-section,
.sidebar {
    min-width: 0;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--muted);
}

/* Feed filters */
.feed-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-chip {
    padding: 0.45rem 0.15rem;
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.filter-chip:hover { color: var(--text); border-bottom-color: var(--border); }
.filter-chip.active { color: var(--text); border-bottom-color: var(--accent); }
.filter-select {
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    margin-left: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
}

.articles {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

/* News cards */
.news-card {
    padding: clamp(0.85rem, 2vw, 1.05rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    box-shadow: 0 8px 20px rgba(26, 26, 26, 0.035);
}
.news-card:first-child {
    padding-top: clamp(0.85rem, 2vw, 1rem);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.meta-left {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1 1 auto;
}
.card-meta time {
    margin-left: auto;
    text-align: right;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}
.content-kind-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.05rem 0.3rem;
    line-height: 1.2;
    white-space: nowrap;
}
.paywall-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #8a4b00;
    background: #fff6e6;
    border: 1px solid #f2d7ae;
    border-radius: 999px;
    padding: 0.05rem 0.3rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Source tags */
.source-tag {
    font-weight: 600;
    font-size: 0.75rem;
    padding-left: 0.45rem;
    border-left: 3px solid #888;
    color: var(--text);
    background: none;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.source-tag.dr { border-left-color: #d32f2f; }
.source-tag.tv2 { border-left-color: #1976d2; }
.source-tag.bt { border-left-color: #e65100; }
.source-tag.ekstrabladet { border-left-color: #c62828; }
.source-tag.berlingske { border-left-color: #1565c0; }
.source-tag.politiken { border-left-color: #283593; }
.source-tag.altinget { border-left-color: #2e7d32; }
.source-tag.information { border-left-color: #4e342e; }
.source-tag.jyllands-posten { border-left-color: #37474f; }
.source-tag.borsen { border-left-color: #00695c; }
.source-tag.avisen { border-left-color: #6a1b9a; }
.source-tag.kristeligt-dagblad { border-left-color: #5d4037; }
.source-tag.nordjyske { border-left-color: #0277bd; }
.source-tag.fyens { border-left-color: #558b2f; }
.source-tag.reddit_denmark { border-left-color: #ff4500; }
.source-tag.reddit_dkpol { border-left-color: #ff6d00; }
.source-tag.ft_api { border-left-color: #455a64; }
.source-tag.dr_politik { border-left-color: #d32f2f; }
.source-tag.dr_indland { border-left-color: #d32f2f; }
.source-tag.frihedsbrevet { border-left-color: #333; }
.source-tag.rss { border-left-color: #e88a1a; }

.news-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: clamp(0.9rem, 1.8vw, 0.98rem);
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.news-card h4 a { color: var(--text); }
.news-card h4 a:hover { color: var(--accent); }
.news-card .summary {
    margin: 0;
    font-size: 0.87rem;
    color: var(--muted);
    line-height: 1.5;
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Mandate info */
.mandate-info {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--muted);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Mandate projection */
.mandate-projection {
    margin-bottom: 0;
    padding: clamp(0.85rem, 2vw, 1rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f6 100%);
}
.mandate-projection h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}
.mandate-bars {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.mandate-bar-row {
    display: grid;
    grid-template-columns: minmax(1.8rem, auto) minmax(0, 1fr) minmax(2.5rem, auto);
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}
.mandate-count {
    width: auto;
    min-width: 2.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #444;
    text-align: right;
    flex-shrink: 0;
}
.bloc-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 0.4rem;
}
.bloc-item.roed { color: #c62828; }
.bloc-item.midten { color: #7b1fa2; }
.bloc-item.blaa { color: #1565c0; }
.mandate-source {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.3rem;
    text-align: right;
    overflow-wrap: anywhere;
}
.mandate-source-group {
    margin-top: 0.25rem;
}
.mandate-source-group .mandate-source {
    margin-top: 0.18rem;
}
.mandate-source--secondary {
    opacity: 0.9;
}

/* Seat change indicator */
.seat-change {
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.2rem;
}
.seat-change.positive { color: #2e7d32; }
.seat-change.negative { color: #c62828; }
.seat-change.neutral { color: var(--muted); }

/* Sidebar */
.sidebar {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}
.polls-widget {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.polls-widget h2 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0;
}

/* Poll items */
.poll-item {
    margin-bottom: 0;
    padding: clamp(0.85rem, 2vw, 1rem);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    box-shadow: 0 8px 20px rgba(26, 26, 26, 0.035);
}
.poll-item--voxmeter {
    margin-top: 0.35rem;
}
.poll-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.45rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.poll-header strong {
    display: block;
    font-size: 0.96rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.poll-date {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: right;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}
.poll-note {
    font-size: 0.7rem;
    color: var(--muted);
    margin: 0.4rem 0 0;
    text-align: right;
    overflow-wrap: anywhere;
}
.poll-note--secondary {
    opacity: 0.9;
}
.poll-bars {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.poll-bar-row {
    display: grid;
    grid-template-columns: minmax(1.8rem, auto) minmax(0, 1fr) minmax(3rem, auto);
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}
.party-label {
    width: auto;
    min-width: 1.8rem;
    font-weight: 700;
    text-align: left;
    flex-shrink: 0;
    overflow-wrap: anywhere;
}
.bar-container {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    min-width: 0;
}
.bar {
    height: 100%;
    border-radius: 2px;
    min-width: 2px;
}
.pct-label {
    width: auto;
    min-width: 3rem;
    font-size: 0.73rem;
    color: var(--muted);
    text-align: right;
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.page-link {
    padding: 0.5rem 0.7rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted);
    border: none;
    background: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.page-link.active {
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
}
.page-link:hover:not(.active) {
    color: var(--text);
}

/* ===== Parties layout ===== */
.party-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 3rem;
}
.party-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1rem, 2vw, 1.25rem);
}
.party-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}
.party-letter {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.party-header h3 { margin: 0; font-size: 1.05rem; }

.bloc-tag {
    font-size: 0.72rem;
    font-weight: 600;
}
.bloc-tag.rød { color: #c62828; }
.bloc-tag.midten { color: #7b1fa2; }
.bloc-tag.blå { color: #1565c0; }

.party-meta {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.85rem;
}
.party-meta p { margin: 0.2rem 0; }
.party-meta strong { color: var(--text); }

.party-politics {
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
    margin-bottom: 0.85rem;
}
.party-politics h4 { margin: 0 0 0.45rem 0; font-size: 0.95rem; }
.summary-content { font-size: 0.88rem; color: #444; line-height: 1.6; }
.summary-content--party {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #2f2f2f;
    overflow-wrap: anywhere;
}
.party-section-title {
    margin: 0.55rem 0 0.2rem 0;
    font-weight: 700;
    color: #202020;
}
.party-summary-list {
    margin: 0.12rem 0 0.4rem 0.95rem;
    padding-left: 0.7rem;
}
.party-summary-list li {
    margin: 0.18rem 0;
}
.party-summary-line {
    margin: 0.2rem 0;
}

.party-link {
    font-size: 0.88rem;
    font-weight: 600;
    display: block;
    margin-top: 0.85rem;
    color: var(--accent);
    padding: 0.5rem 0;
    -webkit-tap-highlight-color: transparent;
}
.party-link:hover { text-decoration: underline; }

/* ===== Om-side ===== */
.om-content {
    max-width: min(640px, 100%);
    margin: 0 auto 3rem;
}
.om-content h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.4rem;
}
.om-content h3:first-child {
    margin-top: 0;
}
.om-content p {
    font-size: 0.93rem;
    line-height: 1.65;
    color: #333;
    margin: 0.3rem 0;
}
.om-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.om-source-list {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444;
    padding-left: 1.2rem;
    margin: 0.4rem 0;
}
.om-source-list li {
    margin-bottom: 0.25rem;
}

.empty-state {
    color: var(--muted);
    font-size: 0.9rem;
}

.poll-stale-warning {
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.site-updated {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    opacity: 0.7;
}

footer {
    text-align: center;
    padding: 1.25rem 0;
    padding-bottom: max(1.25rem, var(--safe-bottom));
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: auto;
    border-top: 1px solid var(--border);
}
footer p {
    margin: 0.15rem 0;
}
footer a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}
footer a:hover {
    color: var(--accent);
}

/* ===== Small phones (< 400px) ===== */
@media (max-width: 399px) {
    .meta-left {
        flex-basis: 100%;
    }
    .filter-select {
        width: 100%;
    }
}

/* ===== Phones & tablets — hamburger nav (< 960px) ===== */
@media (max-width: 959px) {
    .nav-toggle {
        display: block;
        border-radius: 10px;
        background: rgba(200, 16, 46, 0.05);
    }

    .nav-content {
        flex-wrap: nowrap;
        min-height: 52px;
    }

    .main-nav {
        /* Hidden by default, slides open */
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
        padding: 0.5rem 0;
        margin: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 300ms ease, opacity 200ms ease, padding 200ms ease;
        z-index: 105;
    }
    .main-nav.nav-open {
        max-height: min(70dvh, 520px);
        opacity: 1;
        padding: 0.75rem 0;
        overflow-y: auto;
    }
    .main-nav a {
        display: block;
        padding: 0.75rem var(--container-pad);
        padding-left: max(var(--container-pad), var(--safe-left));
        font-size: 1rem;
        font-weight: 600;
        color: var(--text);
        min-height: 48px;
        display: flex;
        align-items: center;
        transition: background 120ms ease;
    }
    .main-nav a:hover,
    .main-nav a:active {
        background: rgba(200, 16, 46, 0.04);
        color: var(--accent);
    }

    .top-nav {
        position: sticky;
        top: 0;
    }

    /* Ensure the top-nav is a positioned ancestor for the dropdown */
    .top-nav .nav-content {
        position: relative;
    }
}

/* ===== Phones (< 600px) ===== */
@media (max-width: 599px) {
    .election-countdown:not(.election-countdown--mobile) {
        display: none;
    }
    .election-countdown.election-countdown--mobile {
        display: inline-flex;
        text-align: center;
        margin: -0.22rem 0 0.18rem;
    }
    .site-tagline {
        margin: 0 0 0.45rem;
        text-align: center;
    }
    .hero {
        padding: 1.1rem 0;
        margin: 1rem 0;
    }

    .hero h2 {
        font-size: 1.25rem;
    }

    .daily-summary,
    .news-card,
    .poll-item,
    .mandate-projection,
    .timeline-card {
        border-radius: 12px;
    }

    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .card-meta time {
        width: 100%;
        margin-left: 0;
    }

    .card-meta time,
    .poll-date,
    .mandate-source,
    .poll-note {
        text-align: left;
    }

    .poll-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Better mobile card spacing */
    .news-card {
        padding: 1rem;
    }
    .news-card h4 {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 0.35rem;
    }
    .news-card .summary {
        font-size: 0.85rem;
        line-height: 1.55;
    }

    /* Bigger poll bars on mobile */
    .bar-container {
        height: 12px;
    }
    .poll-bar-row,
    .mandate-bar-row {
        gap: 0.35rem;
        font-size: 0.82rem;
    }

    /* Stacked filters on mobile */
    .header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .feed-filters {
        gap: 0.35rem;
        align-items: stretch;
    }
    .filter-chip {
        flex: 1 1 calc(50% - 0.35rem);
        justify-content: center;
        padding: 0.65rem 0.6rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--card-bg);
        min-height: 46px;
    }
    .filter-chip:hover {
        border-bottom-color: transparent;
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(200, 16, 46, 0.04);
    }
    .filter-chip.active {
        color: #fff;
        border-bottom-color: transparent;
        background: var(--accent);
        border-color: var(--accent);
    }
    .filter-select {
        margin-left: 0;
    }

    /* Better summary readability */
    .summary-text {
        font-size: 0.9rem;
        line-height: 1.75;
    }

    /* Party cards */
    .party-card {
        padding: 1rem;
    }

    /* Kandidattest cards: bigger tap targets */
    .kandidattest-red-link {
        display: inline-block;
        padding: 0.4rem 0;
    }

    /* Poll chart: proper height on phones, no scroll hack */
    .poll-trend-chart-wrap {
        height: 320px;
        padding: 0.5rem;
    }
    .mobile-day-nav {
        display: block;
        padding: 0.8rem 0 0.9rem;
    }
    .archive-collapsible--mobile-nav {
        margin-bottom: 0;
    }
    .archive-collapsible--mobile-nav .archive-collapsible__header {
        justify-content: space-between;
        padding: 0.8rem 0.95rem;
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,244,244,0.98) 100%);
        box-shadow: 0 10px 24px rgba(26, 26, 26, 0.06);
    }
    .archive-collapsible--mobile-nav .archive-collapsible__body-inner {
        padding-top: 0.75rem;
    }
    .mobile-day-scroll {
        gap: 0.5rem;
        padding: 0.1rem 0 0.25rem;
    }
    .mobile-day-btn {
        min-height: 42px;
        padding: 0.55rem 0.85rem;
        font-size: 0.8rem;
    }
    .mandate-strip {
        padding: 0.75rem 0.85rem;
    }
    .mandate-strip-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }
    .mandate-strip-blocs {
        flex-wrap: wrap;
        gap: 0.35rem 0.55rem;
    }
    .poll-detail-panel--open {
        padding: 0.75rem 1rem;
    }
    .poll-tt-row {
        font-size: 12px;
    }
}

/* ===== Tablet (>= 600px) ===== */
@media (min-width: 600px) {
    .party-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    }

    .filter-select {
        min-width: 11rem;
    }
}

/* ===== Pre-desktop (600-959px) ===== */
@media (min-width: 600px) and (max-width: 959px) {
    .card-meta time,
    .poll-date,
    .mandate-source,
    .poll-note {
        text-align: left;
    }

    .filter-select {
        margin-left: 0;
    }
}

/* ===== Desktop (>= 960px) ===== */
@media (min-width: 960px) {
    .nav-content {
        flex-wrap: nowrap;
        height: 56px;
        gap: 1rem;
    }

    /* Hamburger hidden on desktop (via .nav-toggle display:none default above) */

    /* Hide mobile day nav on desktop */
    .mobile-day-nav {
        display: none;
    }

    /* Show desktop left timeline */
    .left-day-timeline {
        display: block;
        position: fixed;
        left: 10px;
        top: 100px;
        bottom: 20px;
        width: 50px;
        z-index: 90;
        pointer-events: none;
    }
    .left-day-timeline .timeline-dates {
        pointer-events: auto;
    }
    /* When sidebar has collapsible (archive mode), make it wider and clickable */
    .left-day-timeline:has(.archive-collapsible) {
        width: 130px;
        display: flex;
        flex-direction: column;
    }
    .left-day-timeline .archive-collapsible {
        pointer-events: auto;
    }
    .left-day-timeline .archive-collapsible--sidebar {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    .left-day-timeline .archive-collapsible--sidebar .archive-collapsible__body {
        flex: 1 1 auto;
        min-height: 0;
    }
    .left-day-timeline .archive-collapsible--sidebar .archive-collapsible__body-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        position: relative;
    }
    .left-day-timeline .archive-collapsible--sidebar .timeline-dates {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        padding-bottom: 1rem;
    }

    /* Make room for the fixed left timeline */
    .container {
        padding-left: 92px;
    }

    /* Centered single-column feed */
    .grid {
        display: flex;
        flex-direction: column;
        max-width: min(980px, 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .sidebar {
        border-top: none;
        padding-top: 0;
        padding-left: 1.5rem;
        border-left: 1px solid var(--border);
    }

    .polls-widget {
        position: sticky;
        top: 80px;
        padding-right: 0;
    }

    .party-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    }
}

/* ===== Wide desktop (>= 1280px) ===== */
@media (min-width: 1280px) {
    .left-day-timeline {
        left: max(10px, calc((100vw - 1480px) / 2 - 60px));
    }

    .grid {
        max-width: min(980px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Archive collapsible ── */
.archive-collapsible { margin-bottom: 1.5rem; }
.archive-collapsible__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    width: 100%;
}
.archive-collapsible__header:hover {
    background: var(--bg);
    border-color: var(--accent);
}
.archive-collapsible__chevron {
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.archive-collapsible--open > .archive-collapsible__header .archive-collapsible__chevron {
    transform: rotate(45deg);
}
.archive-collapsible__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.archive-collapsible--open > .archive-collapsible__body {
    max-height: none;
}
.archive-collapsible__body-inner {
    padding-top: 1rem;
}
/* Sidebar-specific collapsible */
.archive-collapsible--sidebar {
    pointer-events: auto;
}
.archive-collapsible--sidebar .archive-collapsible__header {
    padding: 0.65rem 0.55rem 0.6rem;
    border: 1px solid rgba(200, 16, 46, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(250,246,246,0.98) 100%);
    justify-content: center;
    align-items: center;
    color: var(--text);
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(26, 26, 26, 0.08);
}
.archive-collapsible--sidebar .archive-collapsible__header:hover {
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,242,242,1) 100%);
    border-color: rgba(200, 16, 46, 0.32);
    transform: translateY(-1px);
}
.archive-collapsible--sidebar .archive-collapsible__chevron {
    width: 0.38em;
    height: 0.38em;
    border-color: var(--muted);
}
.archive-collapsible--sidebar.archive-collapsible--open .archive-collapsible__chevron {
    border-color: var(--accent);
}
.archive-collapsible__sidebar-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: auto;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(200, 16, 46, 0.1);
    color: var(--accent);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.archive-collapsible__sidebar-title {
    display: block;
    width: 100%;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-align: center;
}
.archive-collapsible__sidebar-chevron-row {
    display: flex;
    justify-content: center;
    width: 100%;
}
.archive-collapsible__sidebar-hint {
    display: block;
    width: 100%;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.35;
    text-align: center;
}
.archive-collapsible--open > .archive-collapsible__header .archive-collapsible__sidebar-hint {
    color: var(--accent);
}
/* Mobile day-nav collapsible */
.archive-collapsible--mobile-nav {
    margin-bottom: 0;
}
.archive-collapsible--mobile-nav .archive-collapsible__header {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--bg);
}

/* ── Analyse page ── */
.analyse-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.analyse-stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
}
.analyse-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}
.analyse-stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.25rem;
}
.analyse-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.analyse-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.analyse-filter-bar label {
    font-weight: 600;
    color: var(--muted);
}
.analyse-filter-bar input[type="date"] {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text);
}
.analyse-reset-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.analyse-reset-btn:hover {
    background: var(--border);
}
.analyse-chart-section {
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-soft);
}
.analyse-chart-section h3 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}
.analyse-chart-desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1rem;
}
.analyse-chart-wrapper {
    position: relative;
    width: 100%;
}
.analyse-chart-wrapper--timeseries {
    min-height: 360px;
}
.analyse-chart-wrapper--party {
    min-height: 410px;
}
.analyse-chart-wrapper--sentiment {
    min-height: 320px;
}
.analyse-chart-wrapper--donut {
    max-width: 420px;
    margin: 0 auto;
    min-height: 320px;
}
.analyse-chart-wrapper canvas {
    display: block;
    width: 100% !important;
}
.analyse-chart-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 220px;
    max-width: min(360px, calc(100% - 24px));
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(26, 26, 26, 0.12);
    color: var(--text);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    backdrop-filter: blur(8px);
}
.analyse-chart-tooltip-title {
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.analyse-chart-tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--muted);
}
.analyse-chart-tooltip-row + .analyse-chart-tooltip-row {
    margin-top: 0.35rem;
}
.analyse-chart-tooltip-row--top {
    font-weight: 700;
    color: var(--text);
}
.analyse-chart-tooltip-swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    border: 2px solid currentColor;
    flex: 0 0 0.7rem;
    margin-top: 0.18rem;
}
.analyse-chart-tooltip-label {
    flex: 1 1 auto;
}

@media (max-width: 599px) {
    .analyse-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .analyse-stat-card {
        padding: 1rem 0.75rem;
    }
    .analyse-stat-number {
        font-size: 1.5rem;
    }
    .analyse-chart-section {
        padding: 0.95rem 0.9rem;
        margin-bottom: 1rem;
        border-radius: 16px;
    }
    .analyse-filter-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
        align-items: stretch;
        padding: 0.75rem;
    }
    .analyse-filter-field {
        gap: 0.3rem;
    }
    .analyse-filter-bar label {
        font-size: 0.78rem;
        letter-spacing: 0.01em;
    }
    .analyse-filter-bar input[type="date"],
    .analyse-reset-btn {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }
    .analyse-reset-btn {
        padding: 0.7rem 0.9rem;
        font-weight: 700;
    }
    .analyse-chart-section h3 {
        font-size: 1.02rem;
        line-height: 1.3;
    }
    .analyse-chart-desc {
        font-size: 0.82rem;
        line-height: 1.55;
        margin-bottom: 0.85rem;
    }
    .analyse-chart-wrapper--timeseries {
        min-height: 300px;
    }
    .analyse-chart-wrapper--themes {
        min-height: 320px;
    }
    .analyse-chart-wrapper--party {
        min-height: 380px;
    }
    .analyse-chart-wrapper--sentiment {
        min-height: 290px;
    }
    .analyse-chart-wrapper--donut {
        min-height: 300px;
        max-width: min(100%, 320px);
    }
    .analyse-chart-tooltip {
        display: none;
    }
}
