/* ==========================================================================
   Leading Strand Site Stylesheet
   Design system: CSS custom properties, typography, hero, tab nav, footer
   Mobile-first responsive breakpoints
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --cshl-navy: #004982;
    --cshl-blue: #005190;
    --cshl-green: #b2d883;
    --cshl-accent: #38b6e6;
    --cshl-font: "Source Sans Pro", sans-serif;
}

/* ---------- Overflow Safety ---------- */
html,
body {
    overflow-x: hidden;
}

/* ---------- Base Typography ---------- */
html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
}

body {
    font-family: var(--cshl-font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #212529;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main[role="main"] {
    flex: 1;
}

a {
    color: var(--cshl-navy);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover,
a:focus {
    color: #6588a8;
    text-decoration: none;
}

/* ---------- Utility ---------- */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ==========================================================================
   Hero Banner — Video Background (mobile-first)
   Fixed height forces object-fit: cover to crop top & bottom equally
   ========================================================================== */
.ls-hero {
    position: relative;
    overflow: hidden;
    height: 150px;
    background: #001a2e;
}

/* Video & fallback image: fill the fixed-height box, center-crop */
.ls-hero-video,
.ls-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Subtle vignette — darkens edges, keeps center bright for the logo */
.ls-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(0, 15, 40, 0.35) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Brand: circular logo centered over the globe */
.ls-hero-brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.ls-hero-logo {
    height: 100px;
    width: auto;
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 15px rgba(0, 40, 80, 0.3));
}

.ls-hero-wrapper {
    position: relative;
}

/* Hero profile icon — sits outside .ls-hero to avoid overflow:hidden clipping */
.ls-hero-profile {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1100;
}

/* Hero: sm (>= 576px) */
@media (min-width: 576px) {
    .ls-hero {
        height: 200px;
    }

    .ls-hero-logo {
        height: 140px;
    }
}

/* Hero: md (>= 768px) */
@media (min-width: 768px) {
    .ls-hero {
        height: 260px;
    }

    .ls-hero-logo {
        height: 180px;
    }
}

/* Hero: lg (>= 992px) */
@media (min-width: 992px) {
    .ls-hero {
        height: 320px;
    }

    .ls-hero-logo {
        height: 220px;
    }
}

/* Hero: xl (>= 1400px) */
@media (min-width: 1400px) {
    .ls-hero {
        height: 380px;
    }

    .ls-hero-logo {
        height: 260px;
    }
}

/* ==========================================================================
   Site Tab Navigation (Home | US | Asia) — mobile-first, modern flat style
   ========================================================================== */
.ls-tab-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--cshl-navy);
    position: relative;
}

.ls-tab-nav li {
    flex: 1;
}

/* Mobile base */
.ls-tab-nav li a {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--cshl-font);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.ls-tab-nav li a:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
}

.ls-tab-nav li.active a {
    color: #fff;
    font-weight: 600;
    border-bottom-color: var(--cshl-accent);
}

/* Tab nav: >= 480px */
@media (min-width: 480px) {
    .ls-tab-nav li a {
        font-size: 16px;
        padding: 12px 0;
    }
}

/* Tab nav: lg (>= 992px) */
@media (min-width: 992px) {
    .ls-tab-nav li a {
        font-size: 18px;
        padding: 14px 0;
    }
}

/* ==========================================================================
   Footer Styles
   Ported from archive footer-divisions.css
   ========================================================================== */

/* Mobile base: solid navy */
footer#colophon.site-footer {
    background: var(--cshl-navy);
    color: #fff;
    font-family: var(--cshl-font);
    font-size: 13px;
    line-height: 1.6;
    padding-top: 20px;
    margin-top: 25px;
    min-height: 350px;
}

/* Footer with background image on medium-large screens */
@media (min-width: 768px) {
    footer#colophon.site-footer {
        font-size: 14px;
    }
}

@media (min-width: 768px) and (max-width: 2000px) {
    footer#colophon.site-footer {
        background: var(--cshl-navy) url(../imgs/footer-background2.jpg) no-repeat 50% 100%;
    }
}

/* Footer logo */
.footer-cshl-logo {
    max-width: 160px;
    height: auto;
}

/* Footer headings */
h3.footer-contact-h3 {
    color: var(--cshl-green);
    font-family: var(--cshl-font);
    font-weight: 400;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Footer links */
footer li {
    list-style: none;
}

footer li a {
    color: #fff;
    text-decoration: none;
    font-family: var(--cshl-font);
}

footer li a:hover {
    color: var(--cshl-green);
}

footer p a {
    color: #fff;
    font-family: var(--cshl-font);
}

footer p a:hover {
    color: var(--cshl-green);
}

/* Footer menu column lists */
.footer-menu {
    padding-left: 0;
    list-style: none;
}

.footer-menu li {
    list-style: none;
    margin-bottom: 2px;
}

/* Footer copyright row */
.footer-copyright p {
    font-size: 12px;
    color: #fff;
    font-family: var(--cshl-font);
}

.footer-copyright a {
    color: #fff;
}

.footer-copyright a:hover {
    color: var(--cshl-green);
}

/* Footer Donate / Newsletter buttons */
.btn-donate {
    display: inline-block;
    background-color: var(--cshl-green);
    color: #004982 !important;
    font-weight: 600;
    font-family: var(--cshl-font);
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.btn-donate:hover {
    background-color: #9bc76e;
    color: #003361 !important;
    text-decoration: none;
}

/* Footer newsletter */
.footer-newsletter-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
}

.footer-newsletter-link:hover {
    color: var(--cshl-green);
}

.footer-newsletter-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

/* Footer contact info */
.footer-contact-info {
    line-height: 1.7;
    font-size: 13px;
}

.footer-contact-info a {
    color: #fff;
    text-decoration: none;
}

.footer-contact-info a:hover {
    color: var(--cshl-green);
}

/* Footer social icons */
.footer-social-icons a {
    color: #fff;
    margin-right: 8px;
    transition: color 0.2s;
}

.footer-social-icons a:hover {
    color: var(--cshl-green);
}

/* ==========================================================================
   Content Utilities
   ========================================================================== */
main[role="main"] {
    padding: 0;
}

main[role="main"] .container {
    padding-top: 15px;
    padding-bottom: 15px;
}

/* Wider container for keynote grid pages */
main[role="main"].keynote-main {
    padding: 0 20px;
    padding-bottom: 0 !important;
}

@media (min-width: 1200px) {
    main[role="main"].keynote-main {
        padding: 0 40px;
        max-width: 100%;
    }
}

/* Full-bleed main for meeting media page (no header/footer chrome) */
main[role="main"].media-main {
    padding: 12px 24px 0;
    max-width: 100%;
}

@media (min-width: 1200px) {
    main[role="main"].media-main {
        padding: 12px 40px 0;
    }
}

/* Always show LS logo when CSHL chrome is hidden */
.media-main .meeting-header-logo-link {
    display: block;
}

/* Light mode: make white logo visible via CSS filter */
.media-main .meeting-header-logo {
    filter: brightness(0);
    opacity: 0.35;
    transition: opacity 0.2s;
}

.media-main .meeting-header-logo:hover {
    opacity: 0.55;
}

/* ==========================================================================
   Keynote Lectures Grid (Homepage)
   ========================================================================== */

/* Section header bar */
.keynote-header {
    background: var(--cshl-blue);
    color: #fff;
    padding: 10px 20px;
    margin-bottom: 16px;
}

.keynote-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
    font-family: var(--cshl-font);
}

/* Search bar */
.keynote-search {
    margin-bottom: 20px;
}

.keynote-search-input {
    max-width: 400px;
    width: 100%;
}

/* Accent button (Search Keynotes, etc.) */
.btn-accent {
    background-color: var(--cshl-accent);
    border-color: var(--cshl-accent);
    color: #fff;
    font-weight: 500;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: #2a9fd0;
    border-color: #2a9fd0;
    color: #fff;
}

/* Pagination accent */
.pagination .page-item.active .page-link {
    background-color: var(--cshl-accent);
    border-color: var(--cshl-accent);
    color: #fff;
}

.pagination .page-link {
    color: var(--cshl-navy);
}

.pagination .page-link:hover {
    color: var(--cshl-accent);
}

/* Speaker card grid — auto-fill for compact cards */
.keynote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

@media (min-width: 768px) {
    .keynote-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 1200px) {
    .keynote-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* Individual card */
.keynote-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
    background: #fff;
}

.keynote-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.13);
    transform: translateY(-1px);
}

.keynote-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Square photo with white frame */
.keynote-card-img {
    padding: 10px 10px 0 10px;
    background: #fff;
}

.keynote-card-img img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: top center;
    border: 3px solid #e8e8e8;
    border-radius: 2px;
}

.keynote-card-img-placeholder {
    color: #adb5bd;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    border: 3px solid #e8e8e8;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.keynote-card-body {
    padding: 6px 10px 8px;
}

.keynote-card-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--cshl-navy);
    line-height: 1.3;
}

.keynote-card-meeting {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 1px;
    line-height: 1.3;
}

.keynote-card-title {
    font-size: 0.7rem;
    color: #495057;
    margin-top: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Meeting Tables (US / Asia pages)
   ========================================================================== */
.meeting-section-header {
    background: var(--cshl-blue);
    color: #fff;
    padding: 10px 20px;
    margin-bottom: 0;
}

.meeting-section-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
    font-family: var(--cshl-font);
}

.meeting-table {
    width: 100%;
    margin-bottom: 24px;
}

.meeting-table th {
    background: #e9ecef;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid #dee2e6;
}

.meeting-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.meeting-table tr:hover td {
    background: #f8f9fa;
}

.meeting-table a {
    color: var(--cshl-navy);
    font-weight: 500;
}

.meeting-table a:hover {
    text-decoration: underline;
}

/* Reduce bottom spacing on meeting pages */
.meeting-table:last-child {
    margin-bottom: 8px;
}

/* Meeting table: simple list on mobile — name only */
@media (max-width: 767.98px) {
    .meeting-table thead {
        display: none;
    }

    .meeting-table tbody tr {
        display: block;
        border-bottom: 1px solid #dee2e6;
    }

    .meeting-table tbody tr:last-child {
        border-bottom: none;
    }

    .meeting-table td {
        border-bottom: none;
        padding: 0;
    }

    /* Hide Dates and Expires columns */
    .meeting-table td:nth-child(2),
    .meeting-table td:nth-child(3) {
        display: none;
    }

    /* Meeting name as a tappable row */
    .meeting-table td:first-child {
        display: block;
        padding: 12px 4px;
    }

    .meeting-table td:first-child a {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Meeting Media Page — Video Player + Talk Accordion
   ========================================================================== */
.meeting-media-header {
    border-bottom: 2px solid var(--cshl-blue);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* Header brand: logo + text side by side */
.meeting-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.meeting-header-logo-link {
    display: none;  /* hidden in light mode, shown in theater */
    flex-shrink: 0;
    margin-left: auto;
    padding-right: 4px;
}

.meeting-header-logo {
    height: 68px;
    width: auto;
}

.meeting-header-text {
    flex: 1;
    min-width: 0;
}

.meeting-media-header h1 {
    font-size: 1.5rem;
    color: var(--cshl-navy);
    margin-bottom: 4px;
}

.meeting-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
}

.meeting-media-header .meeting-dates {
    color: #6c757d;
    font-size: 1rem;
}

.meeting-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.meeting-pill:hover {
    background: #dee2e6;
    color: #212529;
    text-decoration: none;
}

.meeting-pill i {
    font-size: 0.72rem;
}

.meeting-description {
    font-size: 0.92rem;
    color: #555;
}

/* Sidebar external-link tabs (Photos, Questionnaire) */
.sidebar-external-tab {
    text-decoration: none !important;
}

.sidebar-tab-ext-icon {
    font-size: 0.6rem;
    opacity: 0.5;
    margin-left: 2px;
    vertical-align: super;
}

/* Questionnaire tab — warm red accent */
.sidebar-tab-q {
    color: #c0392b !important;
    font-weight: 600;
}

.sidebar-tab-q:hover {
    color: #fff !important;
    background: #c0392b !important;
    border-color: #c0392b !important;
}

/* ---------- Video panel ---------- */
.video-panel {
    width: 100%;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Fallback placeholder inside video-wrapper when used with flex */
.video-wrapper.d-flex {
    padding-bottom: 0;
    height: 0;
    padding-bottom: 56.25%;
}

/* ---------- Talk metadata (below video) ---------- */
.talk-metadata-speaker {
    font-weight: 600;
    color: var(--cshl-navy);
    font-size: 1.1rem;
}

.talk-metadata-title {
    font-size: 1rem;
}

.talk-abstract-link {
    cursor: pointer;
    color: var(--cshl-navy);
    transition: color 0.15s;
}

.talk-abstract-link:hover {
    color: var(--cshl-accent);
}

.media-dark .talk-abstract-link {
    color: #a8c8f0;
}

.media-dark .talk-abstract-link:hover {
    color: var(--cshl-accent);
}

/* ---------- Abstract icon button (paper icon next to speaker name) ---------- */
.talk-abstract-icon-btn {
    background: none;
    border: none;
    color: #8a9ab0;
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.85rem;
    vertical-align: middle;
    margin-left: 6px;
    transition: color 0.15s;
}

.talk-abstract-icon-btn:hover {
    color: var(--cshl-accent);
}

.media-dark .talk-abstract-icon-btn {
    color: #6a7a98;
}

.media-dark .talk-abstract-icon-btn:hover {
    color: var(--cshl-accent);
}

/* ---------- Media toggles (dark mode + layout) ---------- */
.media-toggles {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.layout-toggle {
    background: none;
    border: none;
    padding: 4px 6px;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.layout-toggle:hover {
    opacity: 1;
}

.layout-icon {
    display: block;
    vertical-align: middle;
}

/* ---------- Talk accordion ---------- */
.talk-accordion .accordion-button {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cshl-navy);
    padding: 10px 14px;
    background: #f8f9fa;
}

.talk-accordion .accordion-button:not(.collapsed) {
    background: #e9ecef;
    color: var(--cshl-navy);
    box-shadow: none;
}

.talk-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

/* ---------- Talk rows inside accordion ---------- */
.talk-row {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
}

.talk-row:last-child {
    border-bottom: none;
}

.talk-row:hover {
    background: #f0f6ff;
}

.talk-row.talk-active {
    background: #e0edff;
    border-left: 3px solid var(--cshl-accent);
}

.talk-row-speaker {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cshl-navy);
}

.talk-row-title {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Sidebar scrollable on desktop ---------- */
@media (min-width: 992px) {
    #sidebar-talks-pane {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ---------- Full-width mode ---------- */
.media-full-view #videoCol {
    flex: 0 0 100%;
    max-width: 100%;
}

.media-full-view #sidebarCol {
    flex: 0 0 100%;
    max-width: 100%;
}

.media-full-view #questionnairePanel,
.media-full-view #photosPanel {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ---------- Mobile: always stack ---------- */
@media (max-width: 991.98px) {
    .media-split-view #videoCol,
    .media-split-view #sidebarCol {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Layout toggle is meaningless when stacked — hide it */
    #layoutToggle {
        display: none;
    }
}

/* ---------- Theater / Dark mode ---------- */

/* Show header logo in theater mode */
body.media-theater .meeting-header-logo-link {
    display: block;
}

body.media-theater .meeting-header-logo {
    filter: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

body.media-theater .meeting-header-logo:hover {
    filter: none;
    opacity: 1;
}

/* Body-level theater mode — hides chrome, goes full dark */
body.media-theater {
    background: #0d0d1a;
    transition: background 0.3s ease;
}

body.media-theater #site-navigation,
body.media-theater .ls-tab-nav,
body.media-theater .site-footer {
    display: none !important;
}

/* Expand the main container to near-full width in theater mode */
body.media-theater > main.container {
    max-width: 1600px;
    padding-left: 24px;
    padding-right: 24px;
    color: #e0e0e0;
}

/* Header pills in dark mode */
.media-dark .meeting-pill {
    background: #2a2a48;
    color: #b0b0c8;
    border-color: #3a3a5c;
}

.media-dark .meeting-pill:hover {
    background: #3a3a5c;
    color: #e0e0e0;
}

.media-dark .meeting-description {
    color: #9a9ab0;
}

/* Questionnaire tab in dark mode */
.media-dark .sidebar-tab-q {
    color: #e8685a !important;
}

.media-dark .sidebar-tab-q:hover {
    color: #fff !important;
    background: #a83240 !important;
    border-color: #a83240 !important;
}

/* The media container dark theme */
.media-dark {
    background: #12122a;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: -8px -8px 0;
}

.media-dark .meeting-media-header {
    border-bottom-color: #3a3a5c;
}

.media-dark .meeting-media-header h1 {
    color: #e0e0e0;
}

.media-dark .meeting-media-header .meeting-dates {
    color: #9a9ab0;
}

/* Light mode: subtle background on active sidebar tab */
.media-split-view .nav-tabs .nav-link.active,
.media-full-view .nav-tabs .nav-link.active {
    background: #eef3fa;
}

.media-dark .nav-tabs {
    border-bottom-color: #3a3a5c;
}

.media-dark .nav-tabs .nav-link {
    color: #9a9ab0;
}

.media-dark .nav-tabs .nav-link.active {
    background: #252540;
    color: #e0e0e0;
    border-color: #3a3a5c #3a3a5c #252540;
}

.media-dark .nav-tabs .nav-link:hover:not(.active) {
    border-color: #3a3a5c;
    color: #e0e0e0;
}

.media-dark .accordion-item {
    background: #252540;
    border-color: #3a3a5c;
}

.media-dark .talk-accordion .accordion-button {
    background: #2a2a48;
    color: #c0c0d8;
}

.media-dark .talk-accordion .accordion-button:not(.collapsed) {
    background: #303050;
    color: #e0e0e0;
}

.media-dark .talk-accordion .accordion-button::after {
    filter: invert(0.8);
}

.media-dark .talk-row {
    border-bottom-color: #3a3a5c;
}

.media-dark .talk-row:hover {
    background: #303050;
}

.media-dark .talk-row.talk-active {
    background: #2a2a58;
    border-left-color: var(--cshl-accent);
}

.media-dark .talk-row-speaker {
    color: #a8c8f0;
}

.media-dark .talk-row-title {
    color: #b0b0c8;
}

.media-dark .talk-metadata-speaker {
    color: #a8c8f0;
}

.media-dark .talk-metadata-title {
    color: #d0d0e0;
}

.media-dark .talk-metadata-affil {
    color: #8888a8;
}

.media-dark .talk-metadata-details {
    color: #8888a8;
}

.media-dark .layout-toggle {
    color: #9a9ab0;
}

.media-dark .layout-toggle:hover {
    color: #e0e0e0;
}

.media-dark .badge.bg-secondary {
    background: #3a3a5c !important;
}


/* ==========================================================================
   Profile Icon & Dropdown
   ========================================================================== */
.profile-wrapper {
    position: relative;
    display: inline-block;
}

.profile-icon-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.profile-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 260px;
    z-index: 1050;
    display: none;
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: var(--cshl-navy);
}

.profile-dropdown-meetings {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-dropdown-meetings li {
    border-bottom: 1px solid #eee;
}
.profile-dropdown-meetings li:last-child {
    border-bottom: none;
}
.profile-dropdown-meetings li a {
    display: block;
    padding: 8px 16px;
    color: #212529;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.profile-dropdown-meetings li a:hover {
    background: #f8f9fa;
}

.profile-dropdown-footer {
    padding: 8px 16px;
    border-top: 1px solid #dee2e6;
}

/* Profile dropdown: fit small screens */
@media (max-width: 399.98px) {
    .profile-dropdown {
        min-width: 0;
        width: calc(100vw - 24px);
        right: -10px;
    }
}

.btn-navy {
    background-color: var(--cshl-navy);
    border-color: var(--cshl-navy);
    color: #fff;
}

.btn-navy:hover,
.btn-navy:focus {
    background-color: #003a68;
    border-color: #003a68;
    color: #fff;
}

.profile-login-form {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-login-error {
    padding: 6px 16px;
    color: #dc3545;
    font-size: 0.85rem;
}

/* ==========================================================================
   Login Page — Modern Clean Design
   ========================================================================== */
.login-page {
    display: flex;
    justify-content: center;
    padding: 40px 20px 20px;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 36px 40px;
}

/* Help button & panel */
.login-help-wrapper {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.login-help-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--cshl-navy);
    background: #fff;
    color: var(--cshl-navy);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.login-help-btn:hover {
    background: var(--cshl-navy);
    color: #fff;
}

.login-help-panel {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
}

.login-help-panel.open {
    display: block;
}

.login-help-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--cshl-navy);
    border-bottom: 1px solid #dee2e6;
}

.login-help-accordion .accordion-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.login-help-accordion .accordion-button {
    font-size: 0.88rem;
    padding: 10px 16px;
    font-weight: 600;
    color: #333;
}

.login-help-accordion .accordion-button:not(.collapsed) {
    background: #f0f6ff;
    color: var(--cshl-navy);
}

.login-help-accordion .accordion-body {
    font-size: 0.85rem;
    padding: 8px 16px 14px;
    color: #555;
    line-height: 1.5;
}

.login-help-footer {
    padding: 10px 16px;
    border-top: 1px solid #dee2e6;
    font-size: 0.82rem;
    text-align: center;
}

.login-help-footer a {
    color: var(--cshl-accent);
    text-decoration: none;
}

.login-help-footer a:hover {
    color: var(--cshl-navy);
}

@media (max-width: 480px) {
    .login-help-panel {
        width: calc(100vw - 60px);
        right: -8px;
    }
}

.login-meeting-info {
    border-bottom: 2px solid var(--cshl-accent);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.login-meeting-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cshl-navy);
    margin: 0 0 6px;
    line-height: 1.3;
}

.login-meeting-dates {
    font-size: 1rem;
    color: #495057;
    margin: 0 0 8px;
}

.login-meeting-expires {
    font-size: 0.9rem;
    color: #495057;
    margin: 12px 0 0;
}

.login-meeting-expires i {
    margin-right: 4px;
}

.login-card .form-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.login-card .form-control-lg {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 14px;
    font-size: 1rem;
}

.login-card .form-control-lg:focus {
    border-color: var(--cshl-accent);
    box-shadow: 0 0 0 3px rgba(56, 182, 230, 0.15);
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.login-actions .btn-lg {
    padding: 10px 28px;
    font-size: 1rem;
    border-radius: 6px;
}

.btn-outline-questionnaire {
    border: none;
    color: #fff;
    background: var(--cshl-navy);
    font-weight: 500;
}

.btn-outline-questionnaire:hover {
    background: #003a6a;
    color: #fff;
}

.btn-outline-questionnaire i {
    margin-right: 4px;
}

.login-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-links a {
    font-size: 0.9rem;
    color: var(--cshl-accent);
}

.login-links a:hover {
    color: var(--cshl-navy);
}

/* ---------- Sponsor Badge ---------- */
.sponsor-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-top: 16px;
}

.sponsor-badge-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sponsor-badge-img {
    max-width: 180px;
    max-height: 120px;
    object-fit: contain;
}

.sponsor-badge-media {
    margin-top: 8px;
    margin-bottom: 4px;
}

/* ==========================================================================
   Keynote Media Page (YouTube Embed)
   ========================================================================== */
.keynote-media-container {
    margin-bottom: 24px;
}

.keynote-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.keynote-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.keynote-speaker-info {
    padding: 16px 0;
}

.keynote-speaker-info h1 {
    font-size: 1.5rem;
    color: var(--cshl-navy);
    margin-bottom: 4px;
}

.keynote-speaker-info .speaker-affiliation {
    color: #6c757d;
    font-style: italic;
}

.keynote-speaker-info .speaker-meeting {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 4px;
}

.keynote-speaker-info .speaker-talk-title {
    font-size: 1.1rem;
    margin-top: 8px;
}

.related-keynotes h3 {
    font-size: 1.1rem;
    color: var(--cshl-navy);
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

.related-keynote-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.related-keynote-item:last-child {
    border-bottom: none;
}

.related-keynote-img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.related-keynote-info {
    font-size: 0.85rem;
}

.related-keynote-info a {
    font-weight: 600;
    color: var(--cshl-navy);
}

/* ==========================================================================
   Abstract E-Reader — Sidebar rows, Split panel, Full-screen reader, PiP
   ========================================================================== */

/* ---------- Abstract rows in sidebar ---------- */
.abstract-row {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    align-items: flex-start;
}

.abstract-row:last-child {
    border-bottom: none;
}

.abstract-row:hover {
    background: #f0f6ff;
}

.abstract-row.abstract-active {
    background: #e0edff;
    border-left: 3px solid var(--cshl-accent);
}

.abstract-row-num {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--cshl-accent);
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
    padding-top: 1px;
}

.abstract-row-detail {
    min-width: 0;
    flex: 1;
}

.abstract-row-speaker {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--cshl-navy);
}

.abstract-row-title {
    font-size: 0.8rem;
    color: #495057;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.abstract-row-video-icon {
    font-size: 0.65rem;
    color: #999;
    margin-left: 5px;
    opacity: 0.6;
}

/* Entries without an abstract file — greyed out */
.abstract-row-noabs {
    opacity: 0.4;
}

.abstract-row-noabs:hover {
    background: transparent;
}

/* Sidebar scrollable for abstracts pane */
@media (min-width: 992px) {
    #sidebar-abstracts-pane {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ---------- Abstract search ---------- */
.abstract-search {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
}

.abstract-search-input {
    width: 100%;
    border-radius: 4px;
}

.abstract-row.abs-hidden,
.talk-row.abs-hidden {
    display: none;
}

.accordion-item.abs-hidden {
    display: none;
}

/* Dark mode search input */
.media-dark .abstract-search {
    border-bottom-color: #3a3a5c;
}

.media-dark .abstract-search-input {
    background: #2a2a48;
    border-color: #3a3a5c;
    color: #e0e0e0;
}

.media-dark .abstract-search-input::placeholder {
    color: #7a7a98;
}

.media-dark .abstract-search-input:focus {
    background: #303050;
    border-color: var(--cshl-accent);
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(56, 182, 230, 0.15);
}

/* ==========================================================================
   Abstract Toolbar — compact grouped control panel below video
   ========================================================================== */
.abstract-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    float: right;
    margin-top: 8px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 3px 4px;
}

.abstract-toolbar-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    font-size: 0.82rem;
    color: #495057;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.abstract-toolbar-btn:hover {
    background: #e0edff;
    color: var(--cshl-navy);
}

.abstract-toolbar-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.abstract-toolbar-btn:disabled:hover {
    background: none;
    color: #495057;
}

.abstract-toolbar-arrow {
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 30px;
    justify-content: center;
    padding: 2px 6px;
    line-height: 1;
    color: #333;
}

.abstract-toolbar-indicator {
    font-size: 0.78rem;
    color: #6c757d;
    padding: 0 4px;
    min-width: 4em;
    text-align: center;
}

.abstract-toolbar-sep {
    width: 1px;
    height: 16px;
    background: #dee2e6;
    margin: 0 2px;
}

/* Abstract toolbar: larger touch targets on mobile */
@media (max-width: 767.98px) {
    .abstract-toolbar-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .abstract-toolbar-arrow {
        padding: 8px 10px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==========================================================================
   Abstract Split-View Panel (right side, 50/50 with video)
   ========================================================================== */
.abstract-panel-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.abstract-panel-content {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.25) transparent;
}

.abstract-panel-content::-webkit-scrollbar {
    width: 5px;
}

.abstract-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.abstract-panel-content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0);
    border-radius: 3px;
}

.abstract-panel-content:hover::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.25);
}

.abstract-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.45);
}

.abstract-panel-content p {
    margin-bottom: 0.8em;
}

.abstract-panel-content sup {
    font-size: 0.7em;
}

@media (min-width: 992px) {
    .abstract-panel-content {
        max-height: 65vh;
    }
}

/* Shared header styles (used in both split and full-screen) */
.abstract-reader-num {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cshl-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.abstract-reader-speaker {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cshl-navy);
    line-height: 1.3;
}

.abstract-reader-title-display {
    font-size: 0.88rem;
    color: #495057;
    margin-top: 2px;
    font-style: italic;
    line-height: 1.3;
}

/* ==========================================================================
   Full-Screen E-Reader — high contrast, immersive reading
   ========================================================================== */
/* Reader is a fixed overlay covering the viewport.
   Grid layout: arrows in side columns, content scrolls in the middle.
   No overlap = no stacking/click issues. */
.abstract-reader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 80px 1fr 80px;
}

/* Dark e-reader mode */
.abstract-reader-dark {
    background: #1a1a2e;
    color: #e8e8f0;
}

/* Light e-reader mode — optimized for reading */
.abstract-reader-light {
    background: #fafaf8;
    color: #1a1a1a;
}

.abstract-reader-light .abstract-reader-topbar {
    background: rgba(0, 0, 0, 0.04);
}

.abstract-reader-light .abstract-reader-topbar-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: #495057;
}

.abstract-reader-light .abstract-reader-topbar-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #212529;
}

.abstract-reader-light .abstract-reader-topbar-indicator {
    color: #6c757d;
}

.abstract-reader-light .abstract-reader-header {
    border-bottom-color: #e0e0e0;
}

.abstract-reader-light .abstract-reader-speaker {
    color: var(--cshl-navy);
}

.abstract-reader-light .abstract-reader-title-display {
    color: #495057;
}

.abstract-reader-light .abstract-reader-content {
    color: #1a1a1a;
}

.abstract-reader-light .abstract-nav-arrow {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.18);
    color: #495057;
}

.abstract-reader-light .abstract-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--cshl-navy);
    border-color: rgba(0, 0, 0, 0.3);
}

/* Sepia e-reader mode */
.abstract-reader-sepia {
    background: #f4ecd8;
    color: #433422;
}

.abstract-reader-sepia .abstract-reader-topbar {
    background: rgba(100, 70, 30, 0.08);
}

.abstract-reader-sepia .abstract-reader-topbar-btn {
    background: rgba(100, 70, 30, 0.1);
    border-color: rgba(100, 70, 30, 0.2);
    color: #6b5a3e;
}

.abstract-reader-sepia .abstract-reader-topbar-btn:hover {
    background: rgba(100, 70, 30, 0.18);
    color: #433422;
}

.abstract-reader-sepia .abstract-reader-topbar-indicator {
    color: #8a7a5e;
}

.abstract-reader-sepia .abstract-reader-header {
    border-bottom-color: #d4c9a8;
}

.abstract-reader-sepia .abstract-reader-speaker {
    color: #5a3e1a;
}

.abstract-reader-sepia .abstract-reader-title-display {
    color: #6b5a3e;
}

.abstract-reader-sepia .abstract-reader-content {
    color: #433422;
}

.abstract-reader-sepia .abstract-nav-arrow {
    background: rgba(100, 70, 30, 0.08);
    border-color: rgba(100, 70, 30, 0.25);
    color: #6b5a3e;
}

.abstract-reader-sepia .abstract-nav-arrow:hover {
    background: rgba(100, 70, 30, 0.15);
    color: #433422;
    border-color: rgba(100, 70, 30, 0.4);
}

/* ---------- Theme switcher dots ---------- */
.abstract-reader-themes {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
}
.abstract-reader-themes-label {
    font-size: 0.82rem;
    opacity: 0.7;
    margin-right: 2px;
}

.reader-theme-dot {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.reader-theme-dot-light {
    background: #fafaf8;
    border-color: #999;
}

.reader-theme-dot-sepia {
    background: #e8d9b0;
    border-color: transparent;
}

.reader-theme-dot-dark {
    background: #1a1a2e;
    border-color: rgba(255, 255, 255, 0.3);
}

.reader-theme-dot.active {
    box-shadow: 0 0 0 3px rgba(56, 182, 230, 0.6);
}

/* Top bar — spans all 3 grid columns */
.abstract-reader-topbar {
    grid-row: 1;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.3);
    z-index: 3;
}

.abstract-reader-topbar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.abstract-reader-topbar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.abstract-reader-topbar-indicator {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Reader content column — center grid cell, scrolls independently */
.abstract-reader-body {
    grid-row: 2;
    grid-column: 2;
    overflow-y: auto;
    max-width: 100%;
    padding: 40px 48px 80px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

.abstract-reader-body::-webkit-scrollbar {
    width: 6px;
}

.abstract-reader-body::-webkit-scrollbar-track {
    background: transparent;
}

.abstract-reader-body::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0);
    border-radius: 3px;
    transition: background 0.3s;
}

.abstract-reader-body:hover::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
}

.abstract-reader-body::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.5);
}

.abstract-reader-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.abstract-reader-dark .abstract-reader-num {
    color: var(--cshl-accent);
}

.abstract-reader-dark .abstract-reader-speaker {
    color: #e0e8ff;
    font-size: 1.25rem;
}

.abstract-reader-dark .abstract-reader-title-display {
    color: #b0b8d0;
    font-size: 1.05rem;
}

.abstract-reader-dark .abstract-nav-arrow {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

.abstract-reader-dark .abstract-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.abstract-reader-content {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    line-height: 1.8;
    color: #d8d8e8;
    letter-spacing: 0.01em;
}

.abstract-reader-content p {
    margin-bottom: 1.2em;
}

.abstract-reader-content sup {
    font-size: 0.7em;
}

/* Navigation arrows — grid-placed in side columns (no overlap with content) */
.abstract-nav-arrow {
    grid-row: 2;
    align-self: center;
    justify-self: center;
    position: relative;
    z-index: 10;
    background: rgba(0, 0, 0, 0.06);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.abstract-nav-arrow:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #222;
    border-color: rgba(0, 0, 0, 0.3);
}

.abstract-nav-prev {
    grid-column: 1;
}

.abstract-nav-next {
    grid-column: 3;
}

/* PiP Video — CSS-only repositioning (no DOM move, preserves playback) */
.video-col-pip {
    position: absolute;
    width: 0;
    height: 0;
    overflow: visible;
    padding: 0 !important;
    margin: 0 !important;
}

.video-player-pip {
    position: fixed !important;
    bottom: 24px;
    right: 24px;
    width: 280px;
    z-index: 200;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.video-player-pip .video-wrapper {
    border-radius: 0;
}

.video-player-pip .talk-metadata {
    display: none;
}

/* PiP overlay — hidden by default, shown on hover when in PiP mode */
.video-pip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    gap: 4px;
    z-index: 5;
}

.video-pip-overlay i {
    font-size: 1.2rem;
}

.video-col-pip .video-pip-overlay {
    display: flex;
}

.video-col-pip:hover .video-pip-overlay {
    opacity: 1;
}

/* ==========================================================================
   Dark / Theater mode — abstract sidebar rows
   ========================================================================== */
.media-dark .abstract-row {
    border-bottom-color: #3a3a5c;
}

.media-dark .abstract-row:hover {
    background: #303050;
}

.media-dark .abstract-row.abstract-active {
    background: #2a2a58;
    border-left-color: var(--cshl-accent);
}

.media-dark .abstract-row-speaker {
    color: #a8c8f0;
}

.media-dark .abstract-row-title {
    color: #b0b0c8;
}

.media-dark .abstract-row-num {
    color: var(--cshl-accent);
}

.media-dark .abstract-row-video-icon {
    color: #7a7a98;
}

.media-dark .abstract-toolbar-arrow {
    color: #ccc;
}

/* Dark mode toolbar + split-panel */
.media-dark .abstract-toolbar {
    background: #2a2a3a;
    border-color: #444;
}

.media-dark .abstract-toolbar-btn {
    color: #bbb;
}

.media-dark .abstract-toolbar-btn:hover {
    background: #3a3a5a;
    color: #fff;
}

.media-dark .abstract-toolbar-indicator {
    color: #888;
}

.media-dark .abstract-toolbar-sep {
    background: #555;
}

.media-dark .abstract-panel-header {
    border-bottom-color: #3a3a5c;
}

.media-dark .abstract-reader-speaker {
    color: #a8c8f0;
}

.media-dark .abstract-reader-title-display {
    color: #b0b0c8;
}

.media-dark .abstract-panel-content {
    color: #d0d0e0;
}

/* ==========================================================================
   Responsive — Abstract E-Reader
   ========================================================================== */
@media (max-width: 768px) {
    .video-player-pip {
        width: 200px;
        bottom: 12px;
        right: 12px;
    }

    .abstract-reader {
        grid-template-columns: 48px 1fr 48px;
    }

    .abstract-reader-body {
        padding: 24px 12px 60px;
    }

    .abstract-nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .abstract-reader-topbar {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .video-player-pip {
        width: 160px;
        bottom: 8px;
        right: 8px;
    }

    .abstract-reader {
        grid-template-columns: 36px 1fr 36px;
    }

    .abstract-nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
        border-width: 1px;
    }

    .abstract-reader-content {
        font-size: 1rem;
    }

    .abstract-reader-topbar-btn {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
}

/* ==========================================================================
   Questionnaire — Sectioned Card Forms
   ========================================================================== */

/* Page container — centered, similar to login-page */
.q-page {
    display: flex;
    justify-content: center;
    padding: 40px 20px 60px;
}

/* Main form card — wider than login-card for form density */
.q-card {
    width: 100%;
    max-width: 720px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 36px 40px;
}

/* Header area */
.q-header {
    border-bottom: 2px solid var(--cshl-accent);
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.q-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cshl-navy);
    margin: 0 0 4px;
    line-height: 1.3;
}

.q-header-subtitle {
    font-size: 1.1rem;
    color: #495057;
    margin: 0 0 4px;
    font-style: italic;
}

.q-header-dates {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0 0 10px;
}

.q-header-intro {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

/* Section cards */
.q-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    background: #fafbfc;
}

.q-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cshl-navy);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.q-section-title i {
    color: var(--cshl-accent);
    font-size: 0.95rem;
}

.q-section-intro {
    font-size: 0.88rem;
    color: #6c757d;
    margin: -8px 0 16px;
}

/* Individual field wrapper */
.q-field {
    margin-bottom: 18px;
}

.q-field:last-child {
    margin-bottom: 0;
}

.q-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

/* Radio button group — horizontal by default, wraps on narrow screens */
.q-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.q-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-size: 0.84rem;
    color: #495057;
    background: #fff;
    white-space: nowrap;
    user-select: none;
}

.q-radio-option:hover {
    background: #f0f6ff;
    border-color: var(--cshl-accent);
}

.q-radio-option input[type="radio"] {
    accent-color: var(--cshl-accent);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin: 0;
}

.q-radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--cshl-navy);
}

.q-radio-option:has(input:checked) {
    background: #e8f4fd;
    border-color: var(--cshl-accent);
    box-shadow: 0 0 0 1px var(--cshl-accent);
}

/* Submit area */
.q-actions {
    margin-top: 28px;
    text-align: center;
}

.q-actions .btn-lg {
    padding: 12px 40px;
    font-size: 1rem;
    border-radius: 6px;
}

/* Selects and inputs within questionnaire */
.q-section .form-select,
.q-section .form-control {
    max-width: 480px;
}

.q-section textarea.form-control {
    max-width: 100%;
}

/* Disabled sidebar tab (e.g. Photos not yet available) */
.sidebar-tab-disabled {
    color: #aaa !important;
    cursor: default;
}

.sidebar-tab-disabled:hover {
    background: transparent !important;
}

/* Questionnaire iframe panel on Media page */
.q-iframe-panel {
    border: none;
    width: 100%;
    min-height: 80vh;
}

/* Reduce padding when questionnaire is embedded in the media page iframe */
.embed-body .q-page {
    padding: 8px 12px 40px;
}

.embed-body .q-card {
    max-width: 100%;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .q-card {
        padding: 24px 20px;
    }

    .q-section {
        padding: 18px 16px;
    }

    .q-header h1 {
        font-size: 1.25rem;
    }

    .q-radio-group {
        flex-direction: column;
    }

    .q-radio-option {
        border-radius: 6px;
        padding: 12px 14px;
        font-size: 0.9rem;
        white-space: normal;
        min-height: 44px;
    }
}

/* ==========================================================================
   Bookmarks / My Notes
   ========================================================================== */

/* --- Bookmark form (appears under speaker name) --- */
.bookmark-form-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 6px 0;
}

.bookmark-form-inline .form-control {
    max-width: 260px;
    min-width: 140px;
}

.bookmark-time-input {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
    max-width: 64px !important;
    min-width: 64px;
    text-align: center;
}

.bookmark-trigger {
    margin-right: 4px;
}

.bookmark-time {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
    color: var(--cshl-accent);
    cursor: pointer;
    white-space: nowrap;
    min-width: 36px;
    font-weight: 600;
}

.bookmark-time:hover {
    color: var(--cshl-navy);
    text-decoration: underline;
}

.bookmark-edit-input {
    flex: 1;
    min-width: 120px;
}

.bookmark-edit-btn,
.bookmark-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.78rem;
    color: #aaa;
    transition: color 0.15s;
    flex-shrink: 0;
}

.bookmark-edit-btn:hover {
    color: var(--cshl-accent);
}

.bookmark-delete-btn:hover {
    color: #dc3545;
}

/* --- Dark mode bookmark styles --- */
.media-dark .bookmark-bar .btn-outline-secondary {
    color: #bbb;
    border-color: #555;
}

.media-dark .bookmark-bar .btn-outline-secondary:hover {
    background: #444;
    color: #fff;
}

.media-dark .bookmark-edit-btn,
.media-dark .bookmark-delete-btn {
    color: #666;
}

.media-dark .bookmark-edit-btn:hover {
    color: var(--cshl-accent);
}

.media-dark .bookmark-delete-btn:hover {
    color: #dc3545;
}

/* --- My Notes sidebar tab pane --- */
.notes-talk-group {
    margin-bottom: 12px;
}

.notes-talk-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cshl-navy);
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

.notes-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.84rem;
}

.notes-note-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #495057;
}

.notes-footer {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

/* Dark mode notes sidebar */
.media-dark .notes-talk-header {
    color: #a8c8f0;
    border-bottom-color: #3a3a5c;
}

.media-dark .notes-note-text {
    color: #b0b0c8;
}

.media-dark .notes-footer {
    border-top-color: #3a3a5c;
}

/* --- My Notes dedicated page --- */
.my-notes-page {
    max-width: 800px;
    margin: 0 auto;
}

.my-notes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.my-notes-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cshl-navy);
    margin: 0;
}

.my-notes-actions {
    display: flex;
    gap: 8px;
}

.my-notes-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.my-notes-talk-group {
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.my-notes-talk-header {
    background: #f8f9fa;
    padding: 10px 16px;
    border-bottom: 1px solid #e9ecef;
}

.my-notes-speaker {
    font-weight: 600;
    color: var(--cshl-navy);
}

.my-notes-talk-title {
    color: #495057;
    font-style: italic;
    margin-left: 6px;
}

.my-notes-items {
    padding: 4px 0;
}

.my-notes-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.my-notes-item:last-child {
    border-bottom: none;
}

.my-notes-note-text {
    flex: 1;
    color: #333;
}

.my-notes-date {
    white-space: nowrap;
    flex-shrink: 0;
}
