/* ===========================================================================
   MUN TR — stylesheet

   Note: media query conditions cannot contain var(). Breakpoints are written
   as literal pixel values below; an earlier version used var(--breakpoint-*)
   which silently disabled every responsive rule.
   =========================================================================== */

:root {
    color-scheme: dark;

    --bg-start: #0a0e27;
    --bg-end: #1a0a2e;

    --accent: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-3: #ec4899;
    --accent-soft: rgba(59, 130, 246, 0.35);
    /* Separate from --accent: links sit on a dark surface and need more
       lift, while --accent has to stay dark enough for white text on top. */
    --link: #7cb2ff;

    --status-ongoing: #22d3ee;
    --status-open: #34d399;
    --status-past: #8b8b96;
    --status-postponed: #fbbf24;
    --status-dormant: #f87171;
    --status-unknown: #a5a5b5;

    --text-primary: #ffffff;
    --text-secondary: #dcdce8;
    --text-muted: #a2a2b8;

    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.09);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    --radius: 16px;
    --radius-sm: 10px;

    /* Shared by .container and the sticky toolbar's negative margin — if these
       two disagree the toolbar overflows the viewport. */
    --container-pad: var(--space-lg);
}

:root[data-theme='light'] {
    color-scheme: light;

    --bg-start: #f6f7fc;
    --bg-end: #eceaf8;

    --accent: #2563eb;
    --accent-2: #7c3aed;
    --accent-3: #db2777;
    --accent-soft: rgba(37, 99, 235, 0.22);
    --link: #1d4ed8;

    /* Darker than their dark-theme counterparts: each is tinted at 14-20%
       for the badge background, which eats into the contrast ratio. */
    --status-ongoing: #0e7490;
    --status-open: #065f46;
    --status-past: #4b5563;
    --status-postponed: #92400e;
    --status-dormant: #b91c1c;
    --status-unknown: #4b5563;

    --text-primary: #14142b;
    --text-secondary: #3b3b56;
    --text-muted: #61617a;

    --surface: rgba(255, 255, 255, 0.72);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --border: rgba(20, 20, 43, 0.12);
    --border-strong: rgba(20, 20, 43, 0.22);
    --shadow: 0 8px 28px rgba(30, 30, 70, 0.12);
}

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

/* A class that sets `display` outranks the UA stylesheet's [hidden] rule, so
   elements toggled with the hidden attribute need this to actually hide. */
[hidden] {
    display: none !important;
}

body,
h1, h2, h3, p, dl, dd, figure {
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient colour blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    opacity: 0.16;
    filter: blur(160px);
    pointer-events: none;
    z-index: 0;
}

body::before {
    background: var(--accent);
    top: -140px;
    left: -140px;
    animation: blob-float 26s ease-in-out infinite;
}

body::after {
    background: var(--accent-3);
    bottom: -160px;
    right: -140px;
    animation: blob-float 32s ease-in-out infinite reverse;
}

@keyframes blob-float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(40px, -60px); }
    66% { transform: translate(-30px, 30px); }
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--container-pad);
    position: relative;
    z-index: 1;
}

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

.skip-link {
    position: absolute;
    left: var(--space-md);
    top: -100px;
    z-index: 200;
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: var(--space-md);
}

/* ===========================
   Header
   =========================== */
.header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.site-title {
    font-size: clamp(34px, 6vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Keeps the title readable if background-clip is unsupported. */
    color: var(--accent);
}

.site-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 60ch;
}

.header-tools {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.icon-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.icon-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Stats strip */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.header-meta {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.freshness-banner {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: color-mix(in srgb, var(--status-postponed) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-postponed) 45%, transparent);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.freshness-banner strong {
    color: var(--text-primary);
}

.freshness-details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.freshness-details summary::-webkit-details-marker {
    display: none;
}

.freshness-details summary::after {
    content: '▾';
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.freshness-details[open] summary::after {
    transform: rotate(180deg);
}

.freshness-details p {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid color-mix(in srgb, var(--status-postponed) 30%, transparent);
}

/* ===========================
   Toolbar / search
   =========================== */
.toolbar {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 60;
    padding: var(--space-md) var(--container-pad);
    margin-inline: calc(-1 * var(--container-pad));
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

/* Glass only once the page has scrolled — at rest the bar should be invisible.
   Opaque rather than a gradient, so cards never show through it. */
.toolbar.stuck {
    background: color-mix(in srgb, var(--bg-start) 88%, transparent);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom-color: var(--border);
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-bar {
    width: 100%;
    padding: 13px var(--space-lg) 13px var(--space-md);
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-bar:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface-hover);
}

/* The native clear affordance would sit on top of ours. */
.search-bar::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.search-clear:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.filter-toggle {
    padding: 13px var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.filter-toggle[aria-expanded='true'] {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

/* ===========================
   Filters
   =========================== */
.filter-container {
    margin-bottom: var(--space-md);
}

.filter-bar {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
}

.filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.filter-options-stack {
    flex-direction: column;
    align-items: flex-start;
}

.filter-btn {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-soft);
}

.filter-count {
    opacity: 0.65;
    font-weight: 500;
}

/* Still selectable — you may be linking to it — but visibly a dead end. */
.filter-btn.empty {
    opacity: 0.45;
}

.filter-btn.empty:not(.active):hover {
    border-color: var(--border);
    color: var(--text-secondary);
}

.reset-btn {
    justify-self: start;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    grid-column: 1 / -1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-bar.open {
    display: grid;
}

.reset-btn:hover {
    background: color-mix(in srgb, var(--status-dormant) 18%, transparent);
    border-color: var(--status-dormant);
    color: var(--text-primary);
}

/* Active filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
    border-radius: 999px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chip:hover {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
}

.chip-x {
    font-size: 14px;
    line-height: 1;
    opacity: 0.75;
}

.chip-reset {
    background: transparent;
    border-style: dashed;
}

/* Checkboxes */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Drawn from scratch: the native control renders inconsistently against a
   dark surface, and accent-color only styles the checked state. */
.checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    display: grid;
    place-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-input::after {
    content: '';
    width: 9px;
    height: 5px;
    border: 2px solid #fff;
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px) scale(0);
    transition: transform 0.15s ease;
}

.checkbox-input:checked {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
}

.checkbox-input:checked::after {
    transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.checkbox-input:hover {
    border-color: var(--accent);
}

.checkbox-label:hover {
    color: var(--text-primary);
}

/* ===========================
   Controls bar
   =========================== */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.sort-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.sort-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.sort-dropdown {
    padding: 7px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.sort-dropdown:hover,
.sort-dropdown:focus {
    border-color: var(--accent);
    outline: none;
}

.sort-dropdown option {
    background: var(--bg-end);
    color: var(--text-primary);
}

.counter {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ===========================
   State panels
   =========================== */
.state-panel {
    padding: var(--space-2xl) var(--space-lg);
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.state-error {
    border-color: color-mix(in srgb, var(--status-dormant) 45%, transparent);
    background: color-mix(in srgb, var(--status-dormant) 10%, var(--surface));
}

.state-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.state-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    max-width: 60ch;
    margin-inline: auto;
}

/* Loading skeleton */
#loadingState {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.skeleton-card {
    height: 260px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(100deg, var(--surface) 30%, var(--surface-hover) 50%, var(--surface) 70%);
    background-size: 300% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    from { background-position: 150% 0; }
    to { background-position: -50% 0; }
}

/* ===========================
   Conference grid
   =========================== */
.conference-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    align-items: start;
}

.group-heading {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    margin-top: var(--space-sm);
}

.group-heading:first-child {
    margin-top: 0;
}

.render-warning {
    grid-column: 1 / -1;
    padding: var(--space-md);
    border: 1px dashed color-mix(in srgb, var(--status-dormant) 45%, transparent);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.conference-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--status-unknown);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.conference-card:hover {
    transform: translateY(-3px);
    background: var(--surface-hover);
    box-shadow: 0 14px 44px var(--accent-soft);
}

.conference-card.status-ongoing { border-left-color: var(--status-ongoing); }
.conference-card.status-open { border-left-color: var(--status-open); }
.conference-card.status-past { border-left-color: var(--status-past); opacity: 0.82; }
.conference-card.status-postponed { border-left-color: var(--status-postponed); }
.conference-card.status-dormant { border-left-color: var(--status-dormant); }

.conference-card.status-past:hover {
    opacity: 1;
}

.conference-card.flash {
    animation: flash-highlight 2s ease-out;
}

@keyframes flash-highlight {
    0%, 40% { box-shadow: 0 0 0 3px var(--accent); }
    100% { box-shadow: var(--shadow); }
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.card-acronym {
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
    min-width: 0;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.fav-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.fav-btn:hover {
    color: var(--status-postponed);
    border-color: var(--status-postponed);
}

.fav-btn.active {
    color: var(--status-postponed);
    border-color: var(--status-postponed);
    background: color-mix(in srgb, var(--status-postponed) 16%, transparent);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border: 1px solid currentColor;
    color: var(--status-unknown);
    background: color-mix(in srgb, currentColor 14%, transparent);
}

.status-badge.ongoing { color: var(--status-ongoing); }
.status-badge.open { color: var(--status-open); }
.status-badge.past { color: var(--status-past); }
.status-badge.postponed { color: var(--status-postponed); }
.status-badge.dormant { color: var(--status-dormant); }
.status-badge.unknown { color: var(--status-unknown); }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-badge.ongoing .status-dot {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.card-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    overflow-wrap: anywhere;
}

.card-host {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    overflow-wrap: anywhere;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: var(--space-md);
    flex: 1;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-sm);
    font-size: 12px;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.detail-value {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-primary);
    text-align: right;
    overflow-wrap: anywhere;
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-md);
}

.card-badges:empty {
    display: none;
}

.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.badge-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

.badge-free {
    background: color-mix(in srgb, var(--status-open) 20%, transparent);
    border-color: color-mix(in srgb, var(--status-open) 50%, transparent);
    color: var(--status-open);
}

.badge-quiet {
    background: transparent;
    color: var(--text-muted);
}

.expand-btn {
    align-self: stretch;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.expand-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 18px var(--accent-soft);
}

/* Expanded panel */
.card-expanded {
    display: none;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.card-expanded.active {
    display: block;
}

.expanded-section {
    margin-bottom: var(--space-md);
}

.expanded-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--link);
    margin-bottom: 3px;
}

.expanded-section-content {
    font-size: 12.5px;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.muted-note {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-style: italic;
}

.expanded-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.expanded-link:hover {
    text-decoration: underline;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.action-btn {
    padding: 6px 12px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.action-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.expanded-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* ===========================
   Toast + dialog
   =========================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: var(--space-lg);
    transform: translate(-50%, 20px);
    padding: 10px 18px;
    background: var(--surface-strong);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 300;
    max-width: calc(100vw - 2 * var(--space-lg));
    text-align: center;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.to-top {
    position: fixed;
    right: var(--space-lg);
    bottom: var(--space-lg);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--surface-strong);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 250;
}

.to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.to-top:hover {
    border-color: var(--accent);
}

/* Keep the button clear of the toast on narrow screens. */
@media (max-width: 480px) {
    .to-top {
        right: var(--space-md);
        bottom: calc(var(--space-md) + 46px);
    }
}

.shortcuts-dialog {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-end);
    color: var(--text-primary);
    padding: var(--space-xl);
    max-width: 380px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.shortcuts-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.shortcuts-dialog h2 {
    font-size: 17px;
    margin-bottom: var(--space-md);
}

.shortcuts-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-sm) var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
    font-size: 13px;
}

.shortcuts-list dd {
    margin: 0;
    color: var(--text-secondary);
}

kbd {
    display: inline-block;
    min-width: 24px;
    padding: 2px 7px;
    background: var(--surface-strong);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: center;
}

/* ===========================
   Footer
   =========================== */
.footer {
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
    margin-top: var(--space-xl);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer p {
    margin-bottom: var(--space-sm);
}

.footer a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-disclaimer {
    font-style: italic;
    max-width: 62ch;
    margin-inline: auto;
}

/* ===========================
   Responsive — literal breakpoints, not var()
   =========================== */
@media (max-width: 1024px) {
    .conference-grid,
    .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    :root {
        --container-pad: var(--space-md);
    }

    .header-top {
        flex-direction: row;
        align-items: flex-start;
    }

    .site-tagline {
        font-size: 13.5px;
    }

    .header {
        margin-bottom: var(--space-lg);
    }

    .header-top {
        margin-bottom: var(--space-md);
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }

    .stat {
        padding: var(--space-sm) var(--space-md);
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 10px;
        letter-spacing: 0.05em;
    }

    .header-meta {
        gap: var(--space-sm);
        flex-direction: column;
    }

    .freshness-banner {
        font-size: 12px;
        padding: var(--space-sm) var(--space-md);
    }

    .toolbar {
        gap: var(--space-sm);
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .conference-grid,
    .skeleton-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .conference-card {
        padding: var(--space-md);
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .sort-container,
    .controls-right {
        justify-content: space-between;
    }

    .sort-dropdown {
        flex: 1;
        min-width: 0;
    }

    /* 16px keeps iOS from zooming the viewport on focus. */
    .search-bar {
        font-size: 16px;
    }

    /* Heavy blur is expensive on mobile GPUs. */
    .search-bar,
    .filter-bar,
    .conference-card,
    .state-panel,
    .toast {
        backdrop-filter: blur(10px) saturate(150%);
    }

    body::before,
    body::after {
        width: 260px;
        height: 260px;
        filter: blur(110px);
    }
}

@media (max-width: 340px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-wrap: wrap;
    }
}

/* ===========================
   Accessibility
   =========================== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .conference-card:hover {
        transform: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --border: rgba(255, 255, 255, 0.4);
        --text-muted: #c8c8dc;
    }

    :root[data-theme='light'] {
        --border: rgba(20, 20, 43, 0.4);
        --text-muted: #3b3b56;
    }
}

/* ===========================
   Print — a clean handout of the current filter
   =========================== */
@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 10pt;
    }

    body::before,
    body::after,
    .toolbar,
    .to-top,
    .filter-container,
    .filter-chips,
    .controls-bar,
    .header-tools,
    .skip-link,
    .expand-btn,
    .fav-btn,
    .card-actions,
    .toast,
    #loadingState {
        display: none !important;
    }

    .conference-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8pt;
    }

    .conference-card,
    .stat {
        background: none;
        border: 1pt solid #999;
        box-shadow: none;
        backdrop-filter: none;
        break-inside: avoid;
        opacity: 1;
    }

    .site-title,
    .card-acronym,
    .stat-value {
        -webkit-text-fill-color: #000;
        color: #000;
        background: none;
    }

    /* Print every detail, whether or not it was expanded on screen. */
    .card-expanded {
        display: block !important;
    }

    a[href^='http']::after {
        content: ' (' attr(href) ')';
        font-size: 8pt;
        color: #555;
    }
}
