/* Shared overrides for the single note view */
body {
    font-family: 'Poppins', sans-serif;
    font-size: var(--note-font-size-mobile, 14px);
    background-color: #ffffff;
}

@media (min-width: 768px) {
    body {
        font-size: var(--note-font-size-desktop, 16px);
    }
}

.desktop-nav {
    display: none;
}

.rtBibleRef {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* Old desktop nav - hidden always now (replaced by new desktop layout) */
@media (min-width: 1150px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-footer {
        display: none !important;
    }

    body {
        padding-top: 0 !important;
        overflow: hidden;
        height: 100vh;
    }

    body.modal-open {
        overflow: hidden !important;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav {
        position: sticky;
        top: 0;
        z-index: 120;
        display: flex !important;
        align-items: center;
        justify-content: center !important;
        gap: 4px !important;
        padding: 6px 10px;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap !important;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn {
        border: none;
        background: transparent;
        color: #4b5563;
        border-radius: 0;
        padding: 6px 12px;
        display: inline-flex;
        flex: 0 0 auto !important;
        width: 82px !important;
        min-width: 82px !important;
        max-width: none;
        margin: 0 !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        white-space: nowrap;
        font-size: 12px;
        font-weight: 500;
        line-height: 1;
        transition: color 0.15s ease, background 0.15s ease;
        text-decoration: none;
        cursor: pointer;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn:hover {
        background: #f9fafb;
        color: #111827;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn i {
        font-size: 20px;
        margin-bottom: 2px;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn span {
        font-size: 12px;
        font-weight: 500;
        line-height: 1.05;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn-mynotes {
        background: transparent;
        color: #2563eb;
    }

    body.is-dashboard-embed #dashboardTopButtons.desktop-nav .desktop-nav-btn-mynotes:hover {
        color: #1d4ed8;
        background: #f9fafb;
    }

    body.is-dashboard-embed .sp-toggle-wrap,
    body.is-dashboard-embed .desktop-split .side-panel {
        display: none !important;
    }
}

/* ============================================
   DESKTOP SPLIT LAYOUT (≥1150px)
   ============================================ */

@media (min-width: 1150px) {
    /* Main split container */
    .desktop-split {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow: hidden;
        --desktop-panel-min-width: 500px;
        --desktop-panel-max-width: 50vw;
        --desktop-panel-width: 500px;
    }

    .desktop-split .main-area {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        background: #fff;
        position: relative;
    }

    .desktop-split .main-area.has-note {
        background: #f9fafb;
    }

    .desktop-split.desktop-note-view .main-area > #desktopCountdownBar,
    .desktop-split.desktop-note-view .main-area > #desktopVideoToolbar,
    .desktop-split.desktop-note-view .main-area > #desktopLiveVideo {
        display: none;
    }

    .desktop-split .side-panel {
        width: var(--desktop-panel-width);
        min-width: var(--desktop-panel-width);
        max-width: var(--desktop-panel-width);
        display: flex;
        flex-direction: column;
        background: #fff;
        border-right: 1px solid #e5e7eb;
        position: relative;
        order: -1;
    }

    /* Wider side panel when live video is showing */
    .desktop-split .side-panel.side-panel-wide {
        width: var(--desktop-panel-width);
        min-width: var(--desktop-panel-width);
        max-width: var(--desktop-panel-width);
    }

    .side-panel-resizer {
        position: absolute;
        top: 0;
        right: -4px;
        width: 8px;
        height: 100%;
        cursor: col-resize;
        z-index: 120;
        background: transparent;
    }

    .side-panel-resizer::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 3px;
        width: 2px;
        background: transparent;
        transition: background 0.15s ease;
    }

    .side-panel-resizer:hover::after,
    .desktop-split.panel-resizing .side-panel-resizer::after {
        background: #d1d5db;
    }

    /* Side panel content area */
    .side-panel-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
    }

    /* Side panel tab content panes */
    .side-panel-pane {
        display: none;
        width: 100%;
        height: 100%;
    }

    .side-panel-pane.active {
        display: block;
    }

    .side-panel-pane.pane-fill {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    /* Side panel tab bar - at top */
    .side-panel-tabs {
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
        height: 70px;
        min-height: 70px;
        padding: 10px 0 0 0;
        gap: 0;
        flex-shrink: 0;
        order: -1;
    }

    .side-panel-tabs .sp-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        cursor: pointer;
        color: #6b7280;
        font-size: 11px;
        font-weight: 500;
        transition: all 0.15s ease;
        border: none;
        background: none;
        padding: 0;
        gap: 3px;
        position: relative;
    }

    .side-panel-tabs .sp-tab i {
        font-size: 18px;
        transition: transform 0.15s ease;
    }

    .side-panel-tabs.bulletin-toolbar-mode .sp-tab span {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.1;
    }

    .side-panel-tabs .sp-tab:hover {
        color: #111827;
        background: #f3f4f6;
    }

    .side-panel-tabs .sp-tab.active {
        font-weight: 600;
    }

    .side-panel-tabs .sp-tab.active::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: #2563eb;
        border-radius: 2px 2px 0 0;
    }

    /* Give tab special styling */
    .side-panel-tabs .sp-tab.sp-tab-give {
        color: #059669;
    }
    .side-panel-tabs .sp-tab.sp-tab-give:hover {
        background: #ecfdf5;
    }
    .side-panel-tabs .sp-tab.sp-tab-give.active {
        color: #059669;
    }
    .side-panel-tabs .sp-tab.sp-tab-give.active::before {
        background: #059669;
    }

    /* My Notes tab — blue text/icon, no blue background */
    .side-panel-tabs .sp-tab.sp-tab-mynotes {
        color: #2563eb;
        background: #eff6ff;
    }
    .side-panel-tabs .sp-tab.sp-tab-mynotes:hover {
        background: #dbeafe;
        color: #1d4ed8;
    }
    .side-panel-tabs .sp-tab.sp-tab-mynotes.active {
        color: #2563eb;
        background: #eff6ff;
        font-weight: 600;
    }
    .side-panel-tabs .sp-tab.sp-tab-mynotes.active::before {
        background: #2563eb;
    }

    /* Bulletin grid options — smaller titles in desktop side panel */
    .side-panel #bulletin-grid .blt-grid-title {
        font-size: 18px !important;
    }

    /* Countdown bar above video */
    .desktop-countdown-bar {
        width: 100%;
        padding: 20px 24px;
        text-align: center;
        font-family: 'Poppins', sans-serif;
        font-size: 19px;
        color: #374151;
        background: #f9fafb;
        border-bottom: 1px solid #e5e7eb;
    }

    .desktop-video-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid #e5e7eb;
        background: #fff;
    }

    .desktop-video-toolbar .desktop-video-title {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #6b7280;
    }

    .desktop-video-toolbar .desktop-view-toggle {
        display: inline-flex;
        align-items: center;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
        overflow: hidden;
    }

    .desktop-video-toolbar .desktop-view-toggle a {
        text-decoration: none;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: #4b5563;
        padding: 7px 11px;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .desktop-video-toolbar .desktop-view-toggle a:hover {
        background: #e5e7eb;
        color: #111827;
    }

    .desktop-video-toolbar .desktop-view-toggle a.active {
        background: #111827;
        color: #fff;
    }

    .countdown-timer {
        font-weight: 600;
        letter-spacing: 0.2px;
        font-size: 1em;
    }

    .countdown-timer .countdown-label {
        color: #6b7280;
        font-weight: 500;
    }

    .countdown-timer .countdown-number {
        color: #dc2626;
        font-weight: 800;
    }

    .countdown-timer .countdown-part {
        white-space: nowrap;
    }

    .countdown-live-msg {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-weight: 600;
        color: #111827;
        font-size: 19px;
    }

    .countdown-live-msg .live-dot {
        width: 10px;
        height: 10px;
        background: #ef4444;
        border-radius: 50%;
        display: inline-block;
        animation: livePulse 1.5s ease-in-out infinite;
    }

    @keyframes livePulse {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.5; transform: scale(1.3); }
    }

    /* Video player in main area */
    .main-area .live-video-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        background: #fff;
    }

    .main-area .live-video-container iframe {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16/9;
        max-height: 100%;
        border: none;
    }

    .side-panel-video-content {
        height: 100%;
        background: #fff;
    }

    .side-panel-video-content .desktop-video-toolbar {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .side-panel-video-content .desktop-countdown-bar {
        padding: 12px 10px;
        font-size: 14px;
    }

    .side-panel-video-content .desktop-countdown-bar .countdown-live-msg {
        font-size: 14px;
    }

    .side-panel-video-content .live-video-container {
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        background: #fff;
        height: auto;
        min-height: 250px;
    }

    .side-panel-video-content .live-video-container iframe {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
        border: none;
    }

    .desktop-prelive-notice {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16/9;
        max-height: 100%;
        display: none;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 28px;
        background: #e5e7eb;
        color: #111827;
        border: 1px solid #d1d5db;
        box-sizing: border-box;
    }

    .desktop-prelive-notice.show {
        display: flex;
    }

    .desktop-prelive-notice .prelive-card {
        max-width: 760px;
        line-height: 1.5;
    }

    .desktop-prelive-notice .prelive-title {
        font-size: 30px;
        font-weight: 800;
        margin-bottom: 10px;
    }

    .desktop-prelive-notice .prelive-sub {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 10px;
    }

    .desktop-prelive-notice .prelive-note {
        font-size: 15px;
        color: #374151;
        margin-bottom: 6px;
    }

    .desktop-prelive-notice .prelive-link {
        display: inline-block;
        margin-top: 6px;
        color: #1d4ed8;
        font-weight: 700;
        text-decoration: underline;
        word-break: break-all;
    }

    .desktop-prelive-notice .prelive-connect {
        display: none;
        margin-top: 14px;
    }

    .desktop-prelive-notice .prelive-connect.show {
        display: block;
    }

    .desktop-prelive-notice .prelive-connect-label {
        font-size: 14px;
        font-weight: 700;
        color: #111827;
        margin-bottom: 8px;
    }

    .desktop-prelive-notice .prelive-connect-track {
        width: min(460px, 92vw);
        height: 10px;
        border-radius: 999px;
        margin: 0 auto;
        background: #d1d5db;
        overflow: hidden;
        border: 1px solid #9ca3af;
    }

    .desktop-prelive-notice .prelive-connect-bar {
        width: 0%;
        height: 100%;
        background: linear-gradient(90deg, #ef4444, #f59e0b);
        transition: width 10s linear;
    }

    /* Note content inside side panel */
    .side-panel-note-content {
        padding: 0;
    }

    /* When notes are moved into the desktop side panel, reduce only horizontal padding */
    .side-panel-note-content .md\:p-\[55px\] {
        padding-left: 25px !important;
        padding-right: 25px !important;
    }

    /* Hide elements not needed on desktop split */
    .desktop-split .archive-bar-mobile {
        display: none;
    }

    /* Bible pane gets inner spacing on desktop */
    #spPane-bible {
        padding: 12px;
        box-sizing: border-box;
    }

    /* Bible pane fills full height */
    .side-panel-pane .bible-viewport {
        width: 100%;
        height: 100%;
        border-radius: 10px;
        overflow: hidden;
    }

    /* Shift Bible iframe up extra 100px in side panel to hide BG header */
    .side-panel-pane .bible-iframe {
        top: -300px;
        height: calc(100% + 450px);
    }

    /* When live video is showing, hide note from main area */
    .desktop-hide-note {
        display: none !important;
    }

    /* Override body padding for desktop layout */
    body {
        padding: 0 !important;
        padding-bottom: 0 !important;
        margin: 0 !important;
        background: #000 !important;
    }

    /* ---- Collapsible Side Panel ---- */
    .desktop-split .main-area,
    .desktop-split .side-panel {
        transition: width 1s cubic-bezier(0.22, 1, 0.36, 1),
                    min-width 1s cubic-bezier(0.22, 1, 0.36, 1),
                    max-width 1s cubic-bezier(0.22, 1, 0.36, 1),
                    border-color 0.5s ease,
                    flex 1s cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* Collapsed state */
    .side-panel.collapsed,
    .side-panel.side-panel-wide.collapsed {
        width: 0px;
        min-width: 0px;
        max-width: 0px;
        border-right-color: transparent;
        overflow: hidden;
    }

    .side-panel .side-panel-content,
    .side-panel .side-panel-tabs {
        opacity: 1;
        transition: opacity 0.5s ease 0.4s;
    }

    .side-panel.collapsed .side-panel-content,
    .side-panel.collapsed .side-panel-tabs {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* Panel toggle button wrapper - fixed so it stays visible while scrolling */
    .sp-toggle-wrap {
        position: fixed;
        left: var(--desktop-panel-width);
        top: 62px;
        z-index: 100;
        pointer-events: auto;
        transition: left 1s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .desktop-split.panel-collapsed .sp-toggle-wrap {
        left: 0;
    }

    .desktop-split.panel-resizing .main-area,
    .desktop-split.panel-resizing .side-panel,
    .desktop-split.panel-resizing .sp-toggle-wrap {
        transition: none !important;
    }

    /* Toggle button */
    .sp-toggle-btn {
        width: 40px;
        height: 40px;
        background: #fef2f2;
        border: 1px solid #fecaca;
        border-left: none;
        border-radius: 0 8px 8px 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #dc2626;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
        transition: background 0.2s ease, color 0.2s ease;
    }

    .sp-toggle-btn:hover {
        background: #fee2e2;
        color: #b91c1c;
    }

    .sp-toggle-btn i {
        font-size: 15px;
    }

    .sp-toggle-btn .sp-toggle-icon-open {
        display: none;
        color: #16a34a;
    }

    .sp-toggle-btn .sp-toggle-icon-close {
        display: inline-block;
        color: #dc2626;
    }

    .desktop-split.panel-collapsed .sp-toggle-btn {
        background: #f0fdf4;
        border-color: #bbf7d0;
        color: #16a34a;
    }

    .desktop-split.panel-collapsed .sp-toggle-btn:hover {
        background: #dcfce7;
        color: #15803d;
    }

    .desktop-split.panel-collapsed .sp-toggle-btn .sp-toggle-icon-close {
        display: none;
    }

    .desktop-split.panel-collapsed .sp-toggle-btn .sp-toggle-icon-open {
        display: inline-block;
    }
}

/* Below 1150px: hide desktop-only elements, show normal layout */
@media (max-width: 1149px) {
    .desktop-split {
        display: block !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        overflow: visible !important;
    }

    .desktop-split .main-area {
        overflow: visible !important;
        background: transparent !important;
    }

    .desktop-split .side-panel {
        display: none !important;
    }

    .desktop-only-video {
        display: none !important;
    }

    .desktop-countdown-bar {
        display: none !important;
    }

    .desktop-video-toolbar {
        display: none !important;
    }

    .sp-toggle-wrap {
        display: none !important;
    }

    .desktop-hide-note {
        display: block !important;
    }
}

.nav-live-text {
    color: #ef4444 !important;
}

.nav-live-text:hover {
    color: #dc2626 !important;
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
}

/* Install modal */
@media all and (display-mode: standalone) {
    #install-modal-overlay {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

#install-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#install-modal-overlay.show {
    display: flex;
    opacity: 1;
}

#install-modal {
    background: white;
    width: 100%;
    max-width: 450px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Poppins', sans-serif;
}

@media (min-width: 768px) {
    #install-modal-overlay {
        align-items: center;
    }

    #install-modal {
        border-radius: 20px;
        transform: translateY(20px);
        width: 90%;
    }
}

#install-modal-overlay.show #install-modal {
    transform: translateY(0);
}

#install-modal h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

#install-modal p {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
}

.install-primary-btn {
    background-color: #007bff;
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.install-secondary-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.install-text-btn {
    background: #f3f4f6;
    border: none;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
}

.install-never-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
}

.blank-style-classic .fill-blank {
    display: inline-block;
    border: none;
    border-bottom: 2px solid #374151;
    border-radius: 0;
    background: transparent;
    color: #111827;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    height: 1.4em;
    padding: 0 4px;
    margin: 0 2px;
    text-align: center;
    outline: none !important;
    transition: border-color 0.2s;
    box-shadow: none !important;
    caret-color: #2563eb;
}

.blank-style-classic .fill-blank:focus {
    border-bottom-color: #2563eb;
}

.blank-style-classic .fill-blank.correct {
    color: #166534 !important;
    border-bottom-color: #10b981 !important;
    background: transparent !important;
}

.blank-style-classic .fill-blank.incorrect {
    color: #dc2626 !important;
    border-bottom-color: #ef4444 !important;
    background: transparent !important;
}

.blank-style-modern .fill-blank {
    display: inline-block;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f3f4f6;
    color: #111827;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    height: 1.6em;
    padding: 0 5px;
    margin: 0 2px;
    text-align: center;
    outline: none !important;
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    caret-color: #2563eb;
}

.blank-style-modern .fill-blank:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.blank-style-modern .fill-blank:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

.blank-style-modern .fill-blank.correct {
    background: #f0fdf4 !important;
    border-color: #10b981 !important;
    color: #166534 !important;
    box-shadow: none !important;
    transform: none !important;
}

.blank-style-modern .fill-blank.incorrect {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
}

.blank-container {
    position: relative;
    display: inline-block;
}

.reveal-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -24px;
    background: #f3f4f6;
    color: #0f172a;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease, background 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
    pointer-events: none;
}

.reveal-btn:hover,
.reveal-btn:focus {
    background: #e5e7eb;
}
.reveal-btn,
.reveal-btn:hover,
.reveal-btn:focus,
.blank-container.reveal-enabled.active .reveal-btn {
    background: #f3f4f6 !important;
    color: #0f172a !important;
}

#globalRevealBtn {
    background-color: #e5e7eb !important;
}

#globalRevealBtn:hover,
#globalRevealBtn:focus,
#globalRevealBtn:focus-visible,
#globalRevealBtn:active,
#globalRevealBtn:visited {
    background-color: #e5e7eb !important;
}

.blank-container.reveal-enabled.active .reveal-btn {
    opacity: 1 !important;
    visibility: visible !important;
    bottom: -34px !important;
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2) !important;
}

.blank-container.reveal-disabled .reveal-btn {
    display: none !important;
}

.multiline-reveal-wrapper,
.multiline-static-wrapper {
    margin: 20px 0;
    display: block;
    width: 100%;
}

.multiline-reveal-wrapper.multiline-small {
    margin: 24px 0;
}

.reveal-content {
    margin-top: 10px;
}

.reveal-textarea,
.static-textarea,
.user-note-textarea {
    width: 100%;
    border-radius: 8px;
    padding: 15px 12px;
    font-size: 14px;
    outline: none !important;
    resize: none;
    overflow: hidden;
    display: block;
    transition: all 0.2s ease;
}

.reveal-textarea {
    background: #eff6ff;
    border: 1px solid #cbd5e1 !important;
    color: #334155;
}

.static-textarea {
    background: #f8fafc;
    border: 1px solid #d1d5db !important;
    color: #334155;
}

.static-textarea:focus {
    background: #ffffff;
    border-color: #9ca3af !important;
}

.multiline-small .reveal-header {
    display: flex;
    align-items: center;
    gap: 0;
}

.multiline-small .reveal-line {
    flex-grow: 1;
    height: 2px;
    background-color: #2563eb;
    transition: background-color 0.2s;
}

.multiline-small .reveal-toggle-btn {
    background-color: #2563eb;
    color: white;
    font-size: 12px !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.multiline-big .reveal-header-big {
    border: 2px solid #2563eb;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    justify-content: center;
    background-color: white;
}

.multiline-big .reveal-toggle-btn-big {
    background-color: #2563eb;
    color: white;
    font-size: 12px !important;
    font-weight: 600;
    padding: 6px 20px;
    border-radius: 4px;
}

.has-content .reveal-line,
.has-content .reveal-toggle-btn,
.has-content .reveal-header-big,
.has-content .reveal-toggle-btn-big {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.user-note-container {
    margin: 12px 0 16px 0;
    animation: slideDown 0.2s ease-out;
    width: 100%;
    max-width: 100%;
}

.user-note-textarea {
    background: #fefce8;
    border: 1px solid #fde047 !important;
    font-size: 14px;
    color: #854d0e;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    box-sizing: border-box;
}

.note-actions {
    display: flex;
    justify-content: flex-end;
    padding: 5px 0 10px 0;
}

.delete-note-btn {
    color: #ef4444;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.delete-note-btn:hover {
    color: #dc2626;
}

.delete-note-btn i {
    font-size: 10px;
}

.sentence-block.highlighted {
    background-color: #fef08a !important;
    padding: 2px 4px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

#stickyPlayer.hidden {
    display: none !important;
}

.aspect-video {
    aspect-ratio: 16/9;
}

.player-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.verse-fade {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.note-content [style*="text-indent"] {
    text-indent: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.note-content li [style*="text-indent"] {
    text-indent: 0 !important;
    margin-left: 0 !important;
}

p:has(br:only-child) {
    margin: 0;
    line-height: 1.2;
    min-height: 1em;
}

#annotationMenu {
    position: fixed;
    z-index: 10000;
    background: #1f2937;
    border-radius: 8px;
    padding: 8px;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    flex-direction: row;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
    border: 2px solid #fbbf24;
}

#annotationMenu button {
    color: white;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    transition: background 0.1s;
    border: none;
    cursor: pointer;
}

#annotationMenu button:hover {
    background-color: #374151;
}

.menu-divider {
    width: 1px;
    height: 18px;
    background: #4b5563;
    display: block;
}

#shareUrlInput {
    min-width: 0;
}

.multiline-big.has-content .reveal-header-big {
    background-color: white !important;
    border: 2px solid #10b981 !important;
}

.multiline-big.has-content .reveal-toggle-btn-big {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

.has-content .reveal-textarea {
    display: block !important;
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    color: #111827 !important;
}

@keyframes hubShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.hub-btn-animate {
    background: linear-gradient(90deg, #f3f4f6 0%, #e0e7ff 50%, #f3f4f6 100%);
    background-size: 200% 100%;
    animation: hubShimmer 6s infinite linear;
    position: relative;
    overflow: hidden;
}

.hub-btn-animate::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.25);
    pointer-events: none;
}

#personalNoteEditor:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block;
}

#study-view-body p,
#study-view-body div {
    font-size: 14px !important;
    line-height: 1.6 !important;
}

@media (min-width: 768px) {
    #study-view-body p,
    #study-view-body div {
        font-size: 16px !important;
    }
}

.bible-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: white;
}

.bible-iframe {
    width: 100%;
    border: none;
    position: absolute;
    left: 0;
    top: -330px;
    height: calc(100% + 500px);
}

@media (min-width: 768px) {
    .bible-iframe {
        top: -200px;
        height: calc(100% + 350px);
    } 
}

#shareModal .share-modal-body {
    padding: 1.5rem;
    gap: 1.25rem;
}

/* Print Layout Overrides */
@media print {
    @page {
        size: auto;
        margin-top: 0mm;
        margin-bottom: 0mm;
        margin-left: 0.5in;
        margin-right: 0.5in;
    }

    .desktop-nav,
    .mobile-footer,
    #stickyPlayer,
    #annotationMenu,
    #install-modal-overlay,
    #dashToast,
    #copyToast,
    .fixed,
    a[href*="page=archives"],
    .mt-2.text-center.text-xs.text-gray-400,
    .bg-\[\#eff6ff\],
    .max-w-3xl.mx-auto.flex.shadow-md,
    button {
        display: none !important;
    }

    .max-w-5xl > .relative.w-full.h-auto.bg-gray-200,
    img[alt="Sermon Cover"],
    .absolute.top-4.right-4.flex.gap-2,
    .absolute.top-0.right-0.z-20 {
        display: none !important;
    }

    body,
    html {
        background: white !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding-top: 30px !important;
    }

    .max-w-5xl {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    .bg-blue-50 {
        background: transparent !important;
        padding: 0 0 10px 0 !important;
        border-bottom: 2px solid #000 !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .bg-blue-50 h1 {
        color: black !important;
        font-size: 26pt !important;
        margin: 5px 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }

    .bg-blue-50 .text-xs,
    .bg-blue-50 .text-sm,
    .bg-white.text-primary.px-3.py-1.rounded-full {
        background: transparent !important;
        color: #333 !important;
        padding: 0 !important;
        margin: 2px 0 !important;
        box-shadow: none !important;
        display: block !important;
        font-size: 10pt !important;
    }

    .mt-9,
    .mt-4,
    .verse-fade,
    .bg-blue-100 {
        margin-top: 10px !important;
        margin-left: 0 !important;
        background: transparent !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        color: black !important;
        border: none !important;
        padding: 0 !important;
        display: block !important;
        text-align: left !important;
        font-weight: bold !important;
        font-size: 11pt !important;
    }

    .bg-blue-50 i {
        color: #666 !important;
    }

    .note-content,
    .note-content p,
    .note-content li,
    .note-content span {
        font-size: 11pt !important;
        line-height: 1.5 !important;
        color: black !important;
    }

    .note-content p {
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        padding: 0 !important;
    }

    .note-content.prose p,
    .note-content.prose :where(p),
    .note-content.prose > :where(p) {
        margin: 0 !important;
        padding: 0 !important;
    }

    .note-content ul,
    .note-content ol {
        display: block !important;
        list-style-position: outside !important;
        padding-left: 1.5rem !important;
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        overflow: visible !important;
    }

    .note-content ul {
        list-style-type: disc !important;
    }

    .note-content ol {
        list-style-type: decimal !important;
    }
    .note-content ol[type="A" s], .note-content ol[style*="upper-alpha"], .note-content ol[style*="upper-latin"] { list-style-type: upper-alpha !important; }
    .note-content ol[type="A" s] > li, .note-content ol[style*="upper-alpha"] > li, .note-content ol[style*="upper-latin"] > li { list-style-type: upper-alpha !important; }
    .note-content ol[type="A" s] > li::marker, .note-content ol[style*="upper-alpha"] > li::marker, .note-content ol[style*="upper-latin"] > li::marker { content: counter(list-item, upper-alpha) ". "; }
    .note-content ol[type="a" s], .note-content ol[style*="lower-alpha"], .note-content ol[style*="lower-latin"] { list-style-type: lower-alpha !important; }
    .note-content ol[type="a" s] > li, .note-content ol[style*="lower-alpha"] > li, .note-content ol[style*="lower-latin"] > li { list-style-type: lower-alpha !important; }
    .note-content ol[type="a" s] > li::marker, .note-content ol[style*="lower-alpha"] > li::marker, .note-content ol[style*="lower-latin"] > li::marker { content: counter(list-item, lower-alpha) ". "; }
    .note-content ol[type="I" s], .note-content ol[style*="upper-roman"] { list-style-type: upper-roman !important; }
    .note-content ol[type="I" s] > li, .note-content ol[style*="upper-roman"] > li { list-style-type: upper-roman !important; }
    .note-content ol[type="I" s] > li::marker, .note-content ol[style*="upper-roman"] > li::marker { content: counter(list-item, upper-roman) ". "; }
    .note-content ol[type="i" s], .note-content ol[style*="lower-roman"] { list-style-type: lower-roman !important; }
    .note-content ol[type="i" s] > li, .note-content ol[style*="lower-roman"] > li { list-style-type: lower-roman !important; }
    .note-content ol[type="i" s] > li::marker, .note-content ol[style*="lower-roman"] > li::marker { content: counter(list-item, lower-roman) ". "; }

    .note-content li {
        display: list-item !important;
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        padding: 0 !important;
    }

    .note-content h1 {
        font-size: 18pt !important;
        margin-top: 15px !important;
    }

    .note-content h2 {
        font-size: 16pt !important;
        margin-top: 15px !important;
    }

    .note-content h3 {
        font-size: 14pt !important;
        margin-top: 15px !important;
    }

    .fill-blank {
        border: none !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: black !important;
        padding: 0 5px !important;
        font-weight: bold !important;
        min-width: 80px;
        font-size: 11pt !important;
        box-shadow: none !important;
        display: inline-block !important;
        line-height: 1.2 !important;
    }

    input {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .multiline-reveal-wrapper:has(textarea:placeholder-shown),
    .multiline-static-wrapper:has(textarea:placeholder-shown),
    .user-note-container:has(textarea:placeholder-shown),
    div.mt-12.pt-8:has(textarea:placeholder-shown) {
        display: none !important;
    }

    .reveal-toggle-btn,
    .reveal-toggle-btn-big,
    .reveal-btn,
    .reveal-header,
    .reveal-header-big {
        display: none !important;
    }

    .reveal-content {
        display: block !important;
    }

    textarea {
        border: 1px solid #ddd !important;
        resize: none;
        height: auto !important;
        overflow: visible !important;
        page-break-inside: avoid;
        background: #fff !important;
        color: black !important;
        padding: 10px !important;
        margin-top: 10px !important;
        font-size: 11pt !important;
    }

    .text-red-600.font-bold.italic {
        display: none !important;
    }
}







 /* --- KILL SWITCH: HIDE POPUP INSIDE INSTALLED APP --- */
    @media all and (display-mode: standalone) {
        #install-modal-overlay {
            display: none !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }
    }

    /* Popup Overlay */
    #install-modal-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
        z-index: 10000; align-items: flex-end; justify-content: center;
        opacity: 0; transition: opacity 0.3s ease;
    }
    #install-modal-overlay.show { display: flex; opacity: 1; }

    /* Popup Box */
    #install-modal {
        background: white; width: 100%; max-width: 450px;
        border-top-left-radius: 20px; border-top-right-radius: 20px;
        padding: 25px; text-align: center;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        font-family: 'Poppins', sans-serif;
    }
    @media (min-width: 768px) {
        #install-modal-overlay { align-items: center; }
        #install-modal { border-radius: 20px; transform: translateY(20px); width: 90%; }
    }
    #install-modal-overlay.show #install-modal { transform: translateY(0); }

    /* Typography & Buttons */
    #install-modal h3 { margin: 0 0 8px 0; font-size: 20px; font-weight: 700; color: #111827; }
    #install-modal p { margin: 0 0 20px 0; font-size: 15px; color: #6b7280; line-height: 1.5; }
    
    .install-primary-btn {
        background-color: #007bff; color: white; border: none; width: 100%;
        padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600;
        margin-bottom: 12px; cursor: pointer;
        box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    }
    .install-secondary-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
    .install-text-btn {
        background: #f3f4f6; border: none; color: #4b5563; font-size: 13px;
        font-weight: 500; padding: 8px 12px; border-radius: 8px; cursor: pointer; flex: 1;
    }
    .install-never-btn { background: none; border: none; color: #9ca3af; font-size: 12px; cursor: pointer; text-decoration: underline; margin-top: 5px; }











/* --- PRINT STYLES --- */
@media print {
    /* 1. HIDE BROWSER HEADERS/URLS */
    @page {
        size: auto;
        margin-top: 0mm; /* Effectively hides browser header */
        margin-bottom: 0mm; /* Effectively hides browser footer */
        margin-left: 0.5in;
        margin-right: 0.5in;
    }

    /* 2. Hide Global Interface */
    .desktop-nav, .mobile-footer, #stickyPlayer, #annotationMenu, #install-modal-overlay,
    #dashToast, #copyToast, .fixed, a[href*="page=archives"], .mt-2.text-center.text-xs.text-gray-400,
    .bg-\[\#eff6ff\], .max-w-3xl.mx-auto.flex.shadow-md, button {
        display: none !important;
    }

    /* 3. Hide Banner Images & Media Icons */
    .max-w-5xl > .relative.w-full.h-auto.bg-gray-200, img[alt="Sermon Cover"],
    .absolute.top-4.right-4.flex.gap-2, .absolute.top-0.right-0.z-20 {
        display: none !important;
    }

    /* 4. Reset Layout */
    body, html {
        background: white !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding-top: 30px !important; /* Add padding to body to compensate for 0 margin */
    }

    .max-w-5xl {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* 5. CLEAN LEFT-ALIGNED HEADER AREA */
    .bg-blue-50 {
        background: transparent !important;
        padding: 0 0 10px 0 !important;
        border-bottom: 2px solid #000 !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .bg-blue-50 h1 {
        color: black !important;
        font-size: 26pt !important;
        margin: 5px 0 !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }

    /* Metadata */
    .bg-blue-50 .text-xs, 
    .bg-blue-50 .text-sm,
    .bg-white.text-primary.px-3.py-1.rounded-full {
        background: transparent !important;
        color: #333 !important;
        padding: 0 !important;
        margin: 2px 0 !important;
        box-shadow: none !important;
        display: block !important;
        font-size: 10pt !important;
    }

    /* Main Verse Area */
    .mt-9, .mt-4, .verse-fade, .bg-blue-100 {
        margin-top: 10px !important;
        margin-left: 0 !important;
        background: transparent !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        color: black !important;
        border: none !important;
        padding: 0 !important;
        display: block !important;
        text-align: left !important;
        font-weight: bold !important;
        font-size: 11pt !important;
    }

    .bg-blue-50 i { color: #666 !important; }

    /* 6. FORCE FONT SIZES */
    .note-content, 
    .note-content p, 
    .note-content li, 
    .note-content span {
        font-size: 11pt !important;
        line-height: 1.5 !important;
        color: black !important;
    }

    .note-content p {
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        padding: 0 !important;
    }
    .note-content.prose p,
    .note-content.prose :where(p),
    .note-content.prose > :where(p) {
        margin: 0 !important;
        padding: 0 !important;
    }

    .note-content ul,
    .note-content ol {
        display: block !important;
        list-style-position: outside !important;
        padding-left: 1.5rem !important;
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        overflow: visible !important;
    }

    .note-content ul { list-style-type: disc !important; }
    .note-content ol { list-style-type: decimal !important; }
    .note-content ol[type="A" s], .note-content ol[style*="upper-alpha"], .note-content ol[style*="upper-latin"] { list-style-type: upper-alpha !important; }
    .note-content ol[type="A" s] > li, .note-content ol[style*="upper-alpha"] > li, .note-content ol[style*="upper-latin"] > li { list-style-type: upper-alpha !important; }
    .note-content ol[type="A" s] > li::marker, .note-content ol[style*="upper-alpha"] > li::marker, .note-content ol[style*="upper-latin"] > li::marker { content: counter(list-item, upper-alpha) ". "; }
    .note-content ol[type="a" s], .note-content ol[style*="lower-alpha"], .note-content ol[style*="lower-latin"] { list-style-type: lower-alpha !important; }
    .note-content ol[type="a" s] > li, .note-content ol[style*="lower-alpha"] > li, .note-content ol[style*="lower-latin"] > li { list-style-type: lower-alpha !important; }
    .note-content ol[type="a" s] > li::marker, .note-content ol[style*="lower-alpha"] > li::marker, .note-content ol[style*="lower-latin"] > li::marker { content: counter(list-item, lower-alpha) ". "; }
    .note-content ol[type="I" s], .note-content ol[style*="upper-roman"] { list-style-type: upper-roman !important; }
    .note-content ol[type="I" s] > li, .note-content ol[style*="upper-roman"] > li { list-style-type: upper-roman !important; }
    .note-content ol[type="I" s] > li::marker, .note-content ol[style*="upper-roman"] > li::marker { content: counter(list-item, upper-roman) ". "; }
    .note-content ol[type="i" s], .note-content ol[style*="lower-roman"] { list-style-type: lower-roman !important; }
    .note-content ol[type="i" s] > li, .note-content ol[style*="lower-roman"] > li { list-style-type: lower-roman !important; }
    .note-content ol[type="i" s] > li::marker, .note-content ol[style*="lower-roman"] > li::marker { content: counter(list-item, lower-roman) ". "; }

    .note-content li {
        display: list-item !important;
        margin: 0 0 var(--note-paragraph-gap, 0px) 0 !important;
        padding: 0 !important;
    }
    
    .note-content h1 { font-size: 18pt !important; margin-top: 15px !important; }
    .note-content h2 { font-size: 16pt !important; margin-top: 15px !important; }
    .note-content h3 { font-size: 14pt !important; margin-top: 15px !important; }

/* 7. Fill-in-the-Blanks (STRAIGHT LINES) */
    .fill-blank {
        border: none !important;
        /* Force a solid, straight bottom border */
        border-bottom: 1px solid #000 !important; 
        
        /* Eliminate ALL rounding */
        border-radius: 0 !important; 
        -webkit-border-radius: 0 !important;
        -moz-border-radius: 0 !important;
        
        background: transparent !important;
        color: black !important;
        padding: 0 5px !important;
        font-weight: bold !important;
        min-width: 80px;
        font-size: 11pt !important;
        
        /* Ensure no weird shadow artifacts create curves */
        box-shadow: none !important;
        -webkit-box-shadow: none !important;
        
        /* Ensure display is inline-block to respect width/borders */
        display: inline-block !important;
        line-height: 1.2 !important; /* Keep it tight to the text */
    }
	
    
    input {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 8. HIDE EMPTY NOTES LOGIC */
    .multiline-reveal-wrapper:has(textarea:placeholder-shown),
    .multiline-static-wrapper:has(textarea:placeholder-shown),
    .user-note-container:has(textarea:placeholder-shown),
    div.mt-12.pt-8:has(textarea:placeholder-shown) {
        display: none !important;
    }

    /* 9. Format Filled Notes */
    .reveal-toggle-btn, .reveal-toggle-btn-big, .reveal-btn, .reveal-header, .reveal-header-big {
        display: none !important;
    }

    .reveal-content { display: block !important; }

    textarea {
        border: 1px solid #ddd !important;
        resize: none;
        height: auto !important;
        overflow: visible !important;
        page-break-inside: avoid;
        background: #fff !important;
        color: black !important;
        padding: 10px !important;
        margin-top: 10px !important;
        font-size: 11pt !important;
    }
    
    /* Hide admin hints */
    .text-red-600.font-bold.italic {
        display: none !important;
    }
}
