/* Local Fonts */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/poppins-400.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/poppins-600.ttf') format('truetype');
    font-display: swap;
}

/* Local Anek fonts removed to prefer CDN for full weight support */

/* Material Symbols Rounded (Variable via CDN) */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 
   IndianGospel Design System v2 - Material 3 "Divine Light" 
   Refined for Premium "Insta-style" Cards & Glassmorphism
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
    /* Ensure inheritance */
}

html {
    background: transparent;
    /* Prevent white default */
}

body,
button,
input,
textarea,
select {
    font-family: var(--font-primary);
}

body,
html {
    /* bg handled by ::before, but set fallback for dark mode */
    background: transparent;
    color: var(--text-primary);
    min-height: 100vh;
    height: 100%;
    margin: 0;
    overscroll-behavior-y: none;
}

body.dark-mode {
    background: transparent !important;
    --text-primary: #ffffff !important;
    /* Force bright white text in dark mode */
}

/* --- Final Polish: Active States & Icons --- */

/* 1. Global Theme for Selection Buttons & Pills */
.book-btn.active,
.toggle-btn.active,
.number-card.active,
.book-chip.active,
.chapter-circle.active,
.selection-grid-item.active,
.nav-item-number.active,
.card-nav-item.active {
    background: var(--theme-primary) !important;
    color: var(--theme-on-primary) !important;
    border-color: var(--theme-primary) !important;
    font-weight: 700;
}

/* Harmonized Pill (matches lang-toggle-pill subtle bg) */
.verse-pill {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--theme-primary);
    font-weight: 700;
    transition: all 0.2s;
    border-radius: 999px;
    margin: 0 auto;
    overflow: hidden;
    max-width: 95%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
}

body.dark-mode .verse-pill {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--theme-on-primary-soft);
    /* Light Blue Text */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pill-segment {
    padding: 12px 18px;
    font-size: 1.2rem;
    font-weight: 600;
    color: inherit;
    /* Crucial: Inherit from verse-pill */
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure segments inside active navigation items also inherit correct color */
.card-nav-item.active .book-title,
.card-nav-item.active .book-subtitle {
    color: var(--theme-on-primary) !important;
}

/* 2. Expressive Action Buttons (Persistent States) */
.action-btn.active .material-symbols-rounded,
.action-btn.persistent-active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
}

.action-btn.favorite.active .material-symbols-rounded {
    color: #ef4444 !important;
    /* Red Heart */
}

.action-btn.persistent-active .material-symbols-rounded {
    color: var(--theme-primary) !important;
}

.action-btn .material-symbols-rounded {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 3. Success Feedback Animation */
@keyframes pop-success {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.action-btn.success {
    color: var(--theme-primary) !important;
    animation: pop-success 0.3s ease;
}

/* Reading History Badge */
.history-badge {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

body.dark-mode .history-badge {
    background: rgba(255, 255, 255, 0.05);
}

.history-badge span {
    font-size: 14px;
}


body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    /* Premium Logic: Light Mode = Cool Blue Bloom | Dark Mode = Deep Night Sky */
    background: radial-gradient(circle at 50% -10%, #dbeafe 0%, #f8fafc 80%);
    pointer-events: none;
}

body.dark-mode::before {
    /* Deep Ocean Gradient (Restored): now visible through glass surfaces */
    background: radial-gradient(circle at 50% 0%, #00497D 0%, #0f172a 100%);
    background-size: 100% 100%;
    background-attachment: fixed;
}

:root {
    /* Premium Theme Tokens (Blue/Indigo based) */
    --theme-primary: #0061A4;
    --theme-on-primary: #FFFFFF;
    --theme-primary-soft: #D1E4FF;
    --theme-on-primary-soft: #001D36;

    --theme-secondary: #404854;
    /* Darker for better Light Mode contrast */
    --theme-on-secondary: #FFFFFF;
    --theme-secondary-soft: #D7E3F7;
    --theme-on-secondary-soft: #101C2B;

    --theme-surface: #F8F9FF;
    --theme-text-primary: #191C20;
    --theme-surface-dim: #F3F3FA;
    --theme-surface-soft: #EDEDF4;
    --theme-border: #73777F;

    /* Legacy/Compat Variables */
    --text-primary: var(--theme-text-primary);
    --text-secondary: var(--theme-secondary);
    --text-accent: var(--theme-primary);
    --bg-page: var(--theme-surface);
    --bg-paper: #FFFFFF;
    --glass-surface: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(115, 119, 127, 0.2);

    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-telugu: 'Anek Telugu', sans-serif;
    --font-kannada: 'Anek Kannada', sans-serif;
    --font-tamil: 'Anek Tamil', sans-serif;
    --font-malayalam: 'Anek Malayalam', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

/* --- Shared Hero & Action Grid (From index.php) --- */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 140px 20px;
    /* Added bottom padding for Nav */
    text-align: center;
    background: transparent;
    /* Now handled by body */
}

.brand-logo {
    width: 64px;
    height: 64px;
    background: var(--theme-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-bottom: 24px;
    box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.3);
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    font-family: var(--font-heading);
}

.hero-section p.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 300px;
}

/* Home Specific Search Box Replica */
.replica-omnibox {
    width: 100%;
    max-width: 500px;
    background: var(--bg-paper);
    border-radius: 24px;
    padding: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    margin-bottom: 40px;
}

.replica-omnibox .omnibox-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.replica-omnibox .omnibox-label {
    flex: 1;
    text-align: left;
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Dark Mode Tokens */
body.dark-mode {
    --theme-primary: #D1E4FF;
    /* Brighter blue for better visibility on dark */
    --theme-on-primary: #00325B;
    --theme-primary-soft: #00497D;
    --theme-on-primary-soft: #D1E4FF;

    --theme-secondary: #D7E3F7;
    --theme-on-secondary: #253140;
    --theme-secondary-soft: #475a75;
    /* Slightly brighter container */
    --theme-on-secondary-soft: #D7E3F7;

    --theme-surface: #0a0e14;
    /* Deep Black/Blue for better contrast */
    --theme-text-primary: #F0F2F5;
    /* High Emphasis Text */
    --theme-on-surface-variant: #BCC3CC;
    --theme-surface-dim: #15191F;
    --theme-surface-soft: #1C222B;
    --theme-border: #6B7280;
    /* Lighter outline */

    --bg-page: transparent;
    --bg-paper: rgba(20, 25, 35, 0.6);
    /* Glassy Paper */
    --glass-surface: rgba(20, 25, 35, 0.6);
    /* Balanced opacity */
    --glass-border: rgba(255, 255, 255, 0.15);

    /* RE-DECLARE Legacy Vars so they pick up the new tokens */
    --text-primary: var(--theme-text-primary);
    --text-secondary: #D0D6E0;
}

/* In-Card Navigation Grid */
/* In-Card Navigation Wrapper (Static Container) */
.card-nav-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* No global scroll */
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    background: var(--theme-surface-dim);
    /* Match tab rail */
}

/* Scrollable Content Area */
.card-nav-list,
.card-nav-grid {
    flex: 1;
    overflow-y: auto;
    /* Scroll ONLY here */
    padding: 12px 8px;
    /* Reduced horizontal padding for wider cards */
    /* Uniform padding for card grid */
    background: var(--theme-surface);
    /* Light grey background for contrast */
    border-radius: 0 0 0 0;
}

.card-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Gap between book cards */
}

.card-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.card-nav-item {
    padding: 12px 16px;
    /* Comfortable padding */
    border-radius: 12px;
    /* Card rounded corners */
    /* Card rounded corners */
    background: var(--bg-paper);
    /* White Card Background */
    color: var(--theme-text-primary);
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Subtle card shadow */
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    display: flex;
    justify-content: flex-start;
    /* Align left */
    align-items: center;
    gap: 16px;
    /* Space between badge and text */
    width: 100%;
    /* Ensure full width */
}


.card-nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    /* Subtle hover */
}

.card-nav-item:active {
    transform: scale(0.98);
    box-shadow: none;
    background: var(--theme-surface-soft);
}

/* Number Grid (Chapters/Verses) */
.card-nav-grid-numbers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    /* Responsive grid */
    gap: 12px;
    padding: 16px;
    padding: 16px;
    background: var(--bg-paper);
    /* Grid matches active tab/content bg */
    /* Ensure it fills the container and scrolls */
    flex: 1;
    overflow-y: auto;
    width: 100%;
    align-content: start;
    /* Prevent vertical stretching if few items */
}

.nav-item-number {
    aspect-ratio: 1;
    /* Square */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface-dim);
    color: var(--theme-text-primary);
    border-radius: 12px;
    /* Softly rounded squares */
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 1px solid transparent;
}

.nav-item-number:hover {
    background: var(--theme-surface-soft);
}

.nav-item-number:active {
    transform: scale(0.95);
    background: var(--theme-secondary-soft);
}

.nav-item-number.active {
    /* Styles handled by global active rule above */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Book Badge Styles */
.book-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--theme-secondary-soft);
    color: var(--theme-on-secondary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.book-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.book-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* Chrome-Style Tabs */
.nav-tabs-inline {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0 8px;
    background: var(--theme-surface-dim);
    /* Rail Color */
    /* No sticky needed if container is flex col */
    width: 100%;
    margin-bottom: 0;
    flex-shrink: 0;
    /* Don't shrink tabs */
    z-index: 2;
}

.nav-tab-inline {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    border-radius: 16px 16px 0 0;
    /* More rounded */
    background: transparent;
    color: var(--theme-text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    position: relative;
    opacity: 0.7;
}

.nav-tab-inline:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.nav-tab-inline.active {
    background: var(--bg-paper);
    color: var(--theme-primary);
    opacity: 1;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.02);
    /* Subtle lift */
    /* Ensure it connects to the list below */
    margin-bottom: -1px;
    z-index: 3;
}

/* Corner smoothing smoothing helper (optional, handled by radius) */
:root {
    /* Elevation */
    --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15),
        0px 1px 2px 0px rgba(0, 0, 0, 0.3);
    --elevation-2: 0px 4px 8px 3px rgba(0, 0, 0, 0.15),
        0px 1px 3px 0px rgba(0, 0, 0, 0.3);
    --elevation-3: 0px 6px 14px 4px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-heading: 'Playfair Display',
        serif;
    --font-body: 'Inter',
        sans-serif;
    --font-telugu: 'Anek Telugu',
        sans-serif;
    --font-kannada: 'Anek Kannada',
        sans-serif;
    --font-tamil: 'Anek Tamil',
        sans-serif;

    --border-radius-m: 12px;
    --border-radius-l: 24px;
    --border-radius-pill: 50px;
}

body {
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* Material Symbols */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* M3 Search Bar (Voice Enabled) */
.m3-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    height: 56px;
    background: var(--theme-surface-soft);
    border-radius: 28px;
    /* Fully rounded */
    padding: 0 16px;
    box-shadow: var(--elevation-1);
    transition: all 0.2s ease;
    margin: 20px auto;
}

.m3-search-bar:hover,
.m3-search-bar:focus-within {
    background: var(--theme-primary-soft);
    /* M3 interaction state */
    box-shadow: var(--elevation-2);
}

.m3-search-input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
    padding: 0 16px;
    outline: none;
    font-family: var(--font-body);
}

.m3-icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.m3-icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* --- Insta-Flip Reel System (TikTok/Reels Style) --- */
.reader-layout {
    background: transparent !important;
    /* Ensure no background blocks gradient */
    height: 100vh;
    /* Full viewport height */
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    /* The magic snap */
    padding: 0;
    margin: 0;
    /* Hide scrollbar for clean app feel */
    scrollbar-width: none;
    /* Firefox */
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    overscroll-behavior-y: none;
    /* PREVENT RUBBER BANDING/BOUNCE - makes it feel "fixed" */
}

/* Centered Selection Mode */
.reader-layout.selection-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-type: none;
    padding: 20px;
}

/* Modern Pill Toggles */
.toggle-btn {
    padding: 10px 20px;
    border-radius: 99px;
    border: 1px solid var(--theme-border-soft);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    margin: 0 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn.active {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    border-color: var(--theme-primary);
    box-shadow: var(--elevation-1);
}

.reader-layout.lock-scroll {
    overflow-y: scroll !important;
    /* Keep layout consistent */
    touch-action: none;
    /* Block touch gestures */
}

.reader-layout::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* The Card Wrapper (Viewport Size) */
.insta-card {
    height: 100vh;
    /* Full screen per verse */
    width: 100%;
    scroll-snap-align: start;
    /* Snap to top */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
    scroll-snap-stop: always;
    /* Force one verse at a time */
    perspective: 1000px;
    background: transparent !important;
    /* Ensure no overlay */
}

/* The Flipper (Inner) */
.card-inner {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* Readable max-width */
    height: 70vh;
    /* Card doesn't touch full edges */
    /* Card doesn't touch full edges */
    max-height: calc(100vh - 140px);
    /* Ensure it clears the 94px nav + buffer */
    min-height: 400px;
    /* Prevent shrinking too much */
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: var(--elevation-3);
    border-radius: var(--border-radius-l);
    background: transparent;
    /* Container needs to be transparent */
    /* overflow: hidden removed to fix 3D mirroring */
}

/* Soft Background Fill Progress (Logic Only, Visual Disabled) */
.card-face::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    opacity: 0;
    /* REMOVED Visual */
    z-index: 1;
    /* Behind text (z-index 2+) */
    transition: height var(--reading-duration, 5s) linear;
    pointer-events: none;
}

.insta-card.reading-active .card-face::after {
    height: 100%;
}

.insta-card.read-complete .card-face::after {
    height: 100%;
    opacity: 0.02;
    /* Fade back even more when done */
}

body.dark-mode .card-face::after {
    opacity: 0.1;
    /* slightly more visible in dark mode */
}

/* Dark Mode Card Style */
body.dark-mode .card-front,
body.dark-mode .card-back {
    background: rgba(15, 23, 42, 0.85);
    /* Dark Slate Glass - Slightly darker */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    /* Ensure white text */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    /* Deep shadow for dark mode */
}

body.dark-mode .card-inner {
    background: transparent;
    border: none;
}





/* Flipped State */
.reader-layout.global-flipped .insta-card .card-inner,
.insta-card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Front & Back Faces Common */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    /* Vertical Stack */
    padding: 0;
    /* REMOVED GLOBAL PADDING so absolute corners work */
    box-sizing: border-box;
    border-radius: var(--border-radius-l);
    background: transparent;
    overflow: hidden;
    /* Clip progress bar and content here instead */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    /* Softer, deeper shadow */
}

/* Front */
.card-front {
    z-index: 2;
    background: rgba(255, 255, 255, 0.75);
    /* More opaque for readability */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

/* Back */
.card-back {
    transform: rotateY(180deg);
    background: rgba(241, 245, 249, 0.85);
    /* Slightly more opaque for content */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--theme-secondary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Card Header (Pill Area) */
.card-header {
    flex: 0 0 auto;
    /* Don't grow/shrink */
    height: 60px;
    /* Fixed height for pill area */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 10;

    /* Compensation for removed face padding */
    padding-top: 24px;

    /* Separation from body */
    margin-bottom: 16px;
}

.card-body {
    flex: 1 1 auto;
    /* Take remaining space */
    display: flex;
    align-items: center;
    /* Vertically center text */
    justify-content: center;
    /* Horizontally center text */
    overflow: hidden;
    /* Auto-Shrink mode */

    /* MASSIVE Padding to force text shrinking and create white space */
    padding: 20px 32px;

    /* Safe margins */
    width: 100%;
    position: relative;
}

.card-footer {
    /* Push to bottom */
    margin-top: auto;

    /* Compensation for removed face padding */
    padding-bottom: 28px;
    padding-left: 20px;
    padding-right: 20px;

    /* Separation from body */
    padding-top: 16px;

    justify-content: center;
    gap: 20px;
    display: flex;
    width: 100%;
    z-index: 10;
}

/* Content Typography inside Cards */
/* Content Typography inside Cards */
.verse-text-large {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    line-height: 1.8;
    font-weight: 500;
    color: var(--theme-text-primary);
    text-align: center;
    width: 100%;
    max-width: 90%;
    /* Prevent hitting edges */
    z-index: 1;
    /* Ensure text is above background */
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Language Chips (Card Back) */
.lang-chip {
    background: var(--theme-surface-soft);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-soft);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-chip:hover {
    background: var(--theme-secondary-soft);
    color: var(--theme-on-secondary-soft);
    border-color: var(--theme-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* REMOVED Redundant .verse-pill definition */

/* REMOVED Redundant .pill-segment definition that used problematic on-primary color */

.pill-segment:active {
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    transform: none;
}

/* Vertical Separator */
.pill-separator {
    display: block;
    width: 1.5px;
    height: 24px;
    background: currentColor;
    opacity: 0.3;
}

/* Specific Segment Styling */
.pill-book {
    color: inherit;
    font-weight: 700;

    /* Truncation Logic: User requested NEVER truncate */
    white-space: nowrap;
    overflow: hidden;

    /* Flex Logic: Shrink if needed, but don't force grow */
    flex: 0 1 auto;
    min-width: 0;
    /* Crucial for ellipsis in flex */

    padding-left: 24px;
}

.pill-chapter {
    color: inherit;
    opacity: 0.9;
    padding: 14px 24px;

    /* Prevent shrinking */
    flex: 0 0 auto;
}

.pill-verse {
    color: inherit;
    opacity: 0.9;
    padding: 14px 24px;

    /* Prevent shrinking */
    flex: 0 0 auto;
}

/* Footer Actions */
.card-footer {
    flex: 0 0 auto;
    height: 60px;
    /* Slimmer Profile */
    display: flex;
    justify-content: space-evenly;
    /* Even spacing for multiple buttons */
    align-items: center;
    width: 100%;
    z-index: 10;
    padding: 0 10px 8px 10px;
    /* Closer to bottom border */
}

/* Action Button (Shared Style) */
.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    /* Use secondary text color */
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.action-btn .material-symbols-rounded {
    font-size: 26px;
    /* Slightly larger for touch targets */
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.2s;
}

.action-btn:hover {
    background: var(--theme-surface-soft);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: scale(0.92);
    background: var(--theme-secondary-soft);
}

/* Specific Active States */
.action-btn.favorite.active {
    color: #FF4081;
    /* Pink/Red for Heart */
}

.action-btn.favorite.active .material-symbols-rounded {
    font-variation-settings: 'FILL' 1;
    /* Filled Heart */
}

/* Flip icon specific override if needed, but shared style is good */


/* Hide old Reference/Hint */
.verse-reference,
.flip-hint {
    display: none;
}

/* Navigation Overlay (Optional: Next/Prev buttons if requested later) */
/* Floating visual cue for scroll */
.scroll-cue {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-secondary);
    font-size: 2rem;
    animation: bounce 2s infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}


/* Navigation Modal (Overlay) */
.nav-overlay {
    position: fixed;
    top: 60px;
    /* Below Header */
    left: 0;
    right: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-surface);
    backdrop-filter: blur(10px);
    z-index: 99;
    display: flex;
    flex-direction: column;
    padding: 20px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 20px 0 50px 0;
    /* Vertical padding only */
}

/* Seamless Tabs (Segmented Control) */
.m3-tabs {
    display: flex;
    justify-content: center;
    background: var(--theme-surface-dim);
    padding: 4px;
    /* Tighter padding */
    border-radius: 50px;
    margin-bottom: 25px;
    border: none;
    width: 100%;
    /* Expand to container width */
    max-width: 400px;
    /* But keep reasonable max dimensions */
    margin-left: auto;
    margin-right: auto;
}

.m3-tab {
    flex: 1;
    /* Distribute space evenly */
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    text-align: center;
}

.m3-tab.active {
    background: var(--bg-paper);
    color: var(--theme-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Seamless Book List */
.book-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Tighter gap */
    padding: 0;
    /* Remove side padding for full expansion */
    width: 100%;
}

/* Full Width Book Row */
.book-chip {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--bg-paper);
    border: 1px solid var(--theme-border-soft);
    /* Subtle border for separation */
    border-radius: 12px;
    padding: 12px 16px;
    /* Optimized padding */
    text-align: left;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--theme-text-primary);
    box-shadow: none;
    /* Flatter look */
}

/* Hover Effect */
.book-chip:hover {
    transform: scale(1.01);
    background: var(--theme-surface-soft);
}

.book-chip.active {
    background: var(--theme-secondary-soft);
    color: var(--theme-on-secondary-soft);
    border-color: transparent;
}

/* Abbreviation Pill styling inside book-chip */
.book-chip .abbr-pill {
    background: var(--theme-surface-soft);
    color: var(--theme-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    margin-right: 16px;
    min-width: 50px;
    text-align: center;
}

.book-chip.active .abbr-pill {
    background: var(--bg-paper);
    color: var(--theme-primary);
}

/* Chapter Grid */
.chapter-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--theme-border);
}

.chapter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.chapter-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Soft border */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    color: var(--theme-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.chapter-circle:hover {
    background: var(--theme-primary-soft);
    border-color: var(--theme-primary);
    color: var(--theme-on-primary-soft);
}

.chapter-circle.active {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
}


/* Language Cards (Home) M3 */
.lang-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 40px auto;
}

.lang-card {
    background: var(--theme-surface-dim);
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 20px;
    min-width: 140px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.lang-card.selected {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    border-color: var(--theme-primary);
}

.selection-check {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    z-index: 2;
}

.selection-check span {
    font-size: 18px;
    margin-top: 3px;
    margin-right: 3px;
    font-weight: 700;
}

.lang-card.selected .selection-check {
    display: flex;
}

.lang-native {
    font-size: 1.4rem;
    font-weight: 600;
    display: block;
}

.lang-eng {
    font-size: 0.85rem;
    color: var(--theme-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Button M3 */
    color: var(--theme-primary);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Utils */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.text-gradient {
    color: var(--theme-primary);
}

/* Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.02) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

body.dark-mode .sticky-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Specific Fonts */
.te {
    font-family: var(--font-telugu);
}

.kn {
    font-family: var(--font-kannada);
}

.ta {
    font-family: var(--font-tamil);
}

/* Selection Grid items */
.item-card {
    background: var(--bg-paper);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.item-card:hover {
    background: var(--theme-secondary-soft);
    color: var(--theme-on-secondary-soft);
}

.number-card {
    background: var(--bg-paper);
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1;
    font-weight: bold;
    cursor: pointer
}

.item-card:hover,
.number-card:hover {
    background: var(--theme-secondary-soft);
    color: var(--theme-on-secondary-soft);
}

.testament-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

/* Header Language Segmented Control */
/* Header Language Segmented Control */
/* Verse Counter - Page Peel Effect */
.card-corner-index {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 64px;
    height: 64px;

    /* Realistic Curl Gradient - Flattened per request */
    background: linear-gradient(135deg,
            transparent 47%,
            rgba(0, 0, 0, 0.5) 50%,
            var(--theme-primary) 50%);
    /* Effect: Transparent -> Shadow Stripe -> Solid Color */

    /* Shape */
    clip-path: polygon(0 100%, 100% 0, 100% 100%);

    display: flex;
    align-items: flex-end;
    /* Bottom */
    justify-content: flex-end;
    /* Right */

    padding-right: 8px;
    padding-bottom: 8px;
    box-sizing: border-box;

    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--theme-on-primary);

    z-index: 50;
    /* Above Footer */
    pointer-events: none;

    border-bottom-right-radius: var(--border-radius-l);

    /* Drop shadow for the lifted corner */
    filter: drop-shadow(-4px -4px 6px rgba(0, 0, 0, 0.4));
}

.lang-segmented-control {
    display: flex;
    background: var(--theme-surface-soft);
    /* Light Blue Container */
    border-radius: 50px;
    padding: 2px;
    gap: 2px;
    align-items: center;
    cursor: pointer;
    /* Interaction cue for full pill */
}

.lang-segment {
    background: transparent;
    border: none;
    width: 32px;
    /* Fixed circular size */
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    /* Larger, readable font */
    font-weight: 500;
    color: var(--theme-text-primary);
    /* Dark text on light blue */
    border-radius: 50%;
    /* Circle */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.lang-segment.active {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    transform: scale(1.05);
}

/* Immersive Verse Focus Animation */

/* --- SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Deep backdrop */
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    /* Center vertically */
    justify-content: center;
    /* Center horizontally */
    opacity: 0;
    pointer-events: none;
    /* When hidden */
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.search-overlay .search-pill-wrapper {
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 600px;
    position: relative;
    /* For absolute dropdown */
    z-index: 2001;
    /* Above overlay backdrop */
}

/* Omnibox Suggestions */
.omnibox-suggestions {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 100%;
    background: var(--bg-paper);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--theme-border-soft);
    animation: slide-down-fade 0.2s ease-out forwards;
}

@keyframes slide-down-fade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.omnibox-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 16px;
    transition: background 0.1s;
    color: var(--text-primary);
}

.omnibox-item:hover {
    background: var(--theme-surface-soft);
}

.omnibox-item .icon {
    color: var(--theme-secondary);
    font-size: 20px;
}

.omnibox-item .text {
    flex: 1;
    font-weight: 500;
}

.omnibox-item .subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.search-overlay.active .search-pill-wrapper {
    transform: scale(1);
}

.close-search-btn {
    position: absolute;
    top: -70px;
    /* Above the pill */
    left: 50%;
    /* Center horizontally */
    right: auto;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    /* Slightly larger target */
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy */
}

.close-search-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-50%) rotate(90deg);
    /* Maintain center + rotate */
}



@keyframes verse-focus-pulse {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 rgba(0, 73, 125, 0);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
        background: var(--theme-primary-soft);
        /* Subtle highlight */
    }

    100% {
        transform: scale(1);
        box-shadow: none;
        background: var(--bg-paper);
        /* Return to normal */
    }
}

.verse-focus-anim {
    animation: verse-focus-pulse 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 10;
    /* Bring to front during anim */
    position: relative;
}

/* Homepage Search Pill */
.search-pill-wrapper {
    width: 90%;
    max-width: 500px;
    /* Optimal width */
    margin: 0 auto 40px auto;
}

.search-pill-form {
    display: flex;
    align-items: center;
    background: var(--theme-surface-soft);
    border-radius: 50px;
    padding: 4px 6px 4px 20px;
    height: 56px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    position: relative;
    border: 1px solid var(--theme-border-soft);
}

.search-pill-form:focus-within {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background: var(--theme-surface-soft);
    border-color: var(--theme-primary);
}

.search-icon {
    color: var(--theme-secondary);
    font-size: 24px;
    margin-right: 12px;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    color: var(--theme-text-primary);
    outline: none;
    height: 100%;
}

#search-input::placeholder {
    color: var(--theme-text-secondary);
    font-weight: 400;
}

.mic-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--theme-primary-soft);
    color: var(--theme-on-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mic-button:hover {
    background: var(--theme-primary);
    transform: scale(1.05);
}

.mic-button.listening {
    background: #B3261E;
    /* Recording Red */
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(179, 38, 30, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(179, 38, 30, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(179, 38, 30, 0);
    }
}

/* Deep Link Highlight Animation */
.active-verse-highlight {
    animation: highlight-pulse 1.5s ease-out;
    border: 2px solid var(--theme-primary) !important;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 107, 166, 0.4);
        transform: scale(0.98);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(0, 107, 166, 0);
        transform: scale(1.0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 107, 166, 0);
    }
}

/* --- VERSE PROGRESS BAR (Fixed) --- */
.card-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    background: var(--theme-primary);
    z-index: 9999 !important;
    /* Force Visibility */
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    transition: width 0.3s ease;
    opacity: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Ensure no watermark */
.card-watermark,
.card-corner-index {
    display: none !important;
}

/* --- INITIAL BIBLE SELECTION (Phase 26) --- */
/* Centered Container for the Card */
.card-stack-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100dvw;
    height: 100dvh;
    padding: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-default);
    z-index: 50;
    /* Well below Sticky Header (100) */
}

/* The Layout Card Itself */
.verse-card-selection {
    width: 100%;
    max-width: 700px;
    height: auto;
    max-height: 85vh;
    /* Slightly taller on desktop, keeps breathing room */
    background: var(--theme-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    box-shadow: var(--elevation-2);
    border: 1px solid var(--theme-border-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    /* Ensure sizing model is robust */
    /* margin-bottom: 20px; Removed for perfect centering */
}

/* Dark Mode Selection Card */
body.dark-mode .verse-card-selection {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border-soft);
    color: var(--theme-text-primary);
}

/* Dark Mode Toggles/Buttons */
body.dark-mode .toggle-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .toggle-btn.active {
    background: var(--theme-primary) !important;
    color: var(--theme-on-primary) !important;
}

/* Glass Selection Buttons (Standardized) */
.book-btn {
    background: var(--theme-surface-dim);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--theme-border-soft);
    color: var(--theme-text-primary);
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.book-btn:hover {
    background: var(--theme-surface-soft);
    border-color: var(--theme-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .book-btn {
    background: var(--theme-surface-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.dark-mode .book-btn:hover {
    background: var(--theme-surface-soft);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

/* Custom Body for Selection to override generic .card-body */
.card-body-selection {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 10px 24px !important;
    /* Restored padding */
    width: 100%;
    box-sizing: border-box;

    /* Aggressively Hide Scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
}

.card-body-selection::-webkit-scrollbar {
    display: none !important;
}

.bible-option-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Tighter gap */
    width: 100%;
    margin: 0 auto;
}

/* Replicating .lang-card styles from index.php */
/* Replicating .lang-card styles from index.php */
.bible-option-card {
    background: var(--theme-surface-dim);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Back to Column for Text? Or Row? Text is column inside. */
    align-items: flex-start;
    /* Left Aligned */
    justify-content: center;
    min-height: 72px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    box-shadow: var(--elevation-1);
    /* ADDED SHADOW */
}

.bible-option-card:active {
    background: var(--theme-surface-soft);
    transform: scale(0.98);
}

/* Independent Checkbox Button */
.selection-checkbox-btn {
    background: var(--theme-surface-dim);
    border: 1px solid transparent;
    border-radius: 12px;
    width: 72px;
    /* Fixed Width */
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--elevation-1);
    /* ADDED SHADOW */
}

.selection-checkbox-btn span {
    color: var(--theme-on-primary);
    background: var(--theme-border);
    /* Default Gray Circle? */
    /* Actually match Material Checkbox style */
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: transparent;
    /* Hidden check */
    border: 2px solid var(--theme-border);
}

.selection-checkbox-btn.selected {
    background: var(--theme-secondary-soft);
    border-color: var(--theme-primary);
    box-shadow: var(--elevation-2);
    /* Selected Shadow */
}

/* Material 3 Read Button */
#initial-read-btn {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    border-radius: 999px;
    /* Pill Shape */
    padding: 0 32px;
    height: 48px;
    /* Taller */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: var(--elevation-1);
    width: 100%;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

#initial-read-btn:hover {
    box-shadow: var(--elevation-2);
    opacity: 0.95;
}

#initial-read-btn:disabled {
    background: var(--theme-surface-soft);
    color: var(--theme-text-secondary);
    box-shadow: none;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hide Empty Header Dot */
.lang-segmented-control:empty {
    display: none !important;
    padding: 0 !important;
}

/* --- BOOK SELECTION TOGGLES (Phase 27) --- */
.testament-toggles {
    display: flex;
    background: var(--theme-surface-soft);
    border-radius: 999px;
    padding: 4px;
    margin: 16px auto;
    width: fit-content;
    border: 1px solid var(--theme-border-soft);
}

.toggle-btn {
    padding: 8px 20px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn.active {
    background: var(--theme-primary) !important;
    color: var(--theme-on-primary) !important;
    box-shadow: var(--elevation-1);
}

.selection-checkbox-btn.selected span {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-on-primary);
}

/* Dark Mode Overrides for Bible Option Card */
body.dark-mode .bible-option-card {
    background: var(--theme-surface-soft);
    /* Lighter dark */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .bible-option-card .lang-native {
    color: var(--text-primary);
    /* Ensure white text */
}

body.dark-mode .bible-option-card .lang-eng {
    color: var(--text-secondary);
    /* Ensure light gray text */
}

body.dark-mode .bible-option-card:hover {
    background: var(--theme-surface);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Text Container */
.bible-option-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.bible-option-card .lang-native {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bible-option-card .lang-eng {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- SCRIPTURE SELECTOR MODAL (New) --- */
.selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    /* High Z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* When active (via JS logic) */
.selector-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.selector-card {
    background: var(--theme-surface);
    width: 90%;
    max-width: 600px;
    height: 85vh;
    border-radius: 28px;
    box-shadow: var(--elevation-3);
    border: 1px solid var(--theme-border-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.2, 0, 0, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.selector-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--theme-border-soft);
}

.lang-pill-container {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--theme-primary);
}

.selector-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.selector-viewport {
    width: 100%;
    height: 100%;
    position: relative;
}

.selector-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--theme-surface);
    display: none;
    /* Hidden by default */
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.selector-view.active-view {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Animations */
.slide-out-left {
    transform: translateX(-20%);
    opacity: 0;
}

.slide-in-right {
    transform: translateX(20%);
    opacity: 0;
}

/* Grids */
.book-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding-bottom: 40px;
}

.chapter-grid,
.verse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 12px;
    padding-bottom: 40px;
}

/* Buttons */
/* Removed duplicate book-btn in favor of standardized definition above */

.chapter-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--theme-border-soft);
    background: transparent;
    color: var(--theme-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}

.chapter-circle:active,
.chapter-circle.active {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    border-color: var(--theme-primary);
}

/* --- MODERN GRID SYSTEM (Global) --- */

/* Responsive Grid Logic */
/* Responsive Grid Logic */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    /* Reduced from 280px */
    /* Desktop Default */
    gap: 20px;
    padding: 10px 0;
}

/* Modern Card Styles */
/* Modern Card Styles */
.modern-grid-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: row;
    /* Horizontal Layout */
    align-items: center;
    /* Center Vertically */
    justify-content: flex-start;
    min-height: 100px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* Icon Circle */
.card-icon-circle {
    width: 48px;
    height: 48px;
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    margin-right: 16px;
    /* Space between icon and text */
    margin-bottom: 0;
    /* No bottom margin */
    flex-shrink: 0;
}

/* Text Container */
.card-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

/* Typography */
.lang-name-modern {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.lang-sub-modern {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- VERTICAL SELECTION LIST (Card Back) --- */
.carousel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}

.lang-carousel-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Start from top */
    padding: 10px 20px;
    overflow-y: auto;
    /* Allow vertical scroll if many languages */
}

.lang-carousel {
    display: flex;
    flex-direction: column;
    /* Vertical Stack */
    align-items: center;
    gap: 12px;
    width: 100%;
    padding-bottom: 20px;
}

.carousel-slide {
    width: 100%;
    /* Full width of container */
    max-width: 300px;
    background: var(--theme-surface-dim);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Align left */
    height: auto;
    min-height: 80px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}

.carousel-slide:active {
    background: var(--theme-surface-soft);
    transform: scale(0.98);
}

.slide-content {
    display: flex;
    flex-direction: row;
    /* Icon | Text */
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: 100%;
}

.slide-icon {
    width: 40px;
    height: 40px;
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.slide-text {
    text-align: left;
    flex: 1;
}

.slide-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.slide-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    /* Less prominent subtext */
    margin-top: 2px;
}

/* Selection State */
.modern-grid-card.selected {
    border-color: var(--theme-primary);
    background: var(--theme-primary-soft);
}

.modern-grid-card.selected .card-icon-circle {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

/* Remove old checkbox styles if present */
.custom-checkbox {
    display: none !important;
}

/* --- MOBILE OPTIMIZATION (Overrides) --- */
@media screen and (max-width: 600px) {

    /* Use full viewport for selection card */
    .verse-card-selection {
        width: 100dvw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .card-stack-center {
        background: var(--bg-paper) !important;
        /* Match card bg */
    }

    /* Adjust padding for mobile */
    .card-body-selection {
        padding: 5px 16px 20px 16px !important;
    }

    /* Force 2-Column Grid for Mobile */
    .selection-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
        padding: 0 4px;
    }

    /* Reduce Header Size */
    .card-header h2 {
        font-size: 1.5rem !important;
        margin-bottom: 24px;
    }

    /* Search Pill Adjustment */
    .search-pill-wrapper {
        width: 100%;
        margin-bottom: 24px;
    }

    .search-pill-form {
        height: 48px;
    }

    /* Mobile Card Adjustments */
    .modern-grid-card {
        padding: 16px;
        min-height: 140px;
    }

    .card-icon-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
        margin-bottom: 12px;
    }

    .lang-name-modern {
        font-size: 1.1rem;
    }

    /* Action Button Footer */
    .card-footer {
        padding: 16px 20px 24px 20px !important;
    }

    #initial-read-btn {
        height: 56px;
        border-radius: 16px;
        font-size: 1rem;
        font-weight: 600;
        letter-spacing: 0;
        text-transform: none;
        /* Modern style */
    }
}

/* --- DARK MODE OVERRIDES (Card Back) --- */
@media (prefers-color-scheme: dark) {
    .carousel-slide {
        background: var(--theme-surface-dim);
        border-color: var(--theme-border-soft);
    }

    .carousel-slide:active {
        background: var(--theme-surface-soft);
    }

    .slide-title {
        color: #F1F5F9;
    }

    .slide-sub {
        color: #94A3B8;
    }

    .slide-icon {
        background: var(--theme-primary);
        color: var(--theme-on-primary);
    }
}

/* Letter Icon Styling */
.letter-icon {
    font-size: 32px !important;
    font-weight: 600;
    line-height: 1;
    /* Removed global padding to use specific overrides below */
}

/* Script-Specific Alignment (Optical Corrections) */
.lang-icon-en {
    padding-top: 0px;
    /* Reset */
}

.lang-icon-ta {
    padding-top: 0px;
    /* Reset based on user feedback */
}

.lang-icon-te {
    padding-top: 8px;
    /* Further adjustment */
}

.lang-icon-kn {
    padding-top: 8px;
    /* Confirmed */
}

/* Media Queries */
/* Explicit Toggle Support (Overrides Media Query if needed, or works in Light Mode) */
body.dark-mode .carousel-slide {
    background: var(--theme-surface-dim);
    border-color: var(--theme-border-soft);
}

body.dark-mode .carousel-slide:active {
    background: var(--theme-surface-soft);
}

body.dark-mode .slide-title {
    color: #F1F5F9;
}

body.dark-mode .slide-sub {
    color: #94A3B8;
}

body.dark-mode .slide-icon {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

/* --- PERSISTENT BOTTOM NAVIGATION (SVG Bezier Curve) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    /* Reduced from 94px for compact look */
    z-index: 3000;

    /* Remove Gradient - Using SVG now */
    background: transparent;
    border-top: none;

    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: env(safe-area-inset-bottom);

    /* Aggressive Removal of all possible ridges */
    filter: none !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* SVG Container */
.nav-bg-svg {
    position: absolute;
    /* Fix for persistent "ridge" / hairline gap */
    top: -1px;
    height: calc(100% + 1px);

    left: 0;
    width: 100%;

    z-index: -1;
    pointer-events: none;
}

/* SVG Path Color */
#nav-curve-path {
    fill: #ffffff;

    /* Ridge Fix: Add stroke of same color to cover sub-pixel gaps */
    stroke: #ffffff;
    stroke-width: 1px;
    vector-effect: non-scaling-stroke;

    transition: fill 0.3s ease, stroke 0.3s ease;
}

body.dark-mode #nav-curve-path {
    /* Lighter Slates for Contrast against #020617 Body */
    /* Surface Color: #1e293b (Slate 800) matches cards? */
    /* Or #0f172a (Slate 900) if body is darker? */
    /* Let's try #1e293b to ensure the hole (Body #020617) is visible */
    /* Let's try #1e293b to ensure the hole (Body #020617) is visible */
    fill: #1e293b;
    stroke: #1e293b;
    /* Match fill to kill ridge */
}

/* Ensure body dark mode doesn't override via specificity */
body.dark-mode .bottom-nav {
    background: transparent;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: var(--theme-text-secondary);
    flex: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    z-index: 2;
    gap: 4px;
}

.nav-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item .material-symbols-rounded {
    font-size: 26px;
    transition: all 0.3s;
}

/* --- ACTIVE STATE --- */
.nav-item.active .nav-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transform: none;

    /* Transparent: Reveal Body */
    background: transparent !important;

    color: var(--theme-text-primary);

    box-shadow: none;
    border: none;

    margin-top: -5px;
    /* Alignment for 72px deep elliptical cup */
}

body.dark-mode .nav-item.active .nav-icon-wrapper {
    background: transparent !important;
    color: #ffffff;
    box-shadow: none;
}

/* Active Icon */
.nav-item.active .material-symbols-rounded {
    font-size: 38px;
    /* filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1)); <-- Potentially seen as a ridge? Removing just in case */
    filter: none !important;
    font-variation-settings: 'FILL' 1;
}

/* Label */
.nav-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.3s;
    margin-top: 2px;
}

.nav-item.active .nav-label {
    opacity: 1;
    font-weight: 700;
    color: var(--theme-text-primary);
    transform: none;
    z-index: 10;
    position: relative;
    /* Cleanly below the 72px cut */
    margin-top: 10px;
}

body.dark-mode .nav-item.active .nav-label {
    color: #ffffff;
}

/* Remove old pseudo-elements */
.nav-item.active .nav-icon-wrapper::before,
.nav-item.active .nav-icon-wrapper::after {
    content: none;
    display: none;
}

/* --- Action Grid & Cards (Shared with index.php) --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
}

.action-card {
    background: var(--bg-paper);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.action-card:active {
    transform: scale(0.96);
    background: var(--theme-surface-soft);
}

.action-card .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--theme-surface-soft);
    color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all 0.3s ease;
}

.action-card:hover .card-icon {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

.action-card .card-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
}

.action-card .card-sub-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -12px;
}

/* Specific to Bible Selection Grid */
.bible-selection-hero {
    text-align: center;
    margin-bottom: 32px;
}

.bible-selection-hero h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.bible-selection-hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Ensure centering in fixed stack */
.card-stack-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100dvw;
    height: 100dvh;
    padding: 20px;
    box-sizing: border-box;
}

/* Remove Card Styles for Bibles View */
/* Selected State for Action Cards */
.action-card.selected {
    border-color: var(--theme-primary);
    background: var(--theme-primary-soft);
}

.action-card.selected .card-icon {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

/* Floating Action Button for Confirmation */
.confirm-fab {
    position: fixed;
    bottom: 100px;
    right: 24px;
    background: var(--theme-primary);
    color: var(--theme-on-primary);
    border: none;
    padding: 16px 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(0, 69, 125, 0.3);
    cursor: pointer;
    z-index: 4000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.confirm-fab:active {
    transform: scale(0.95);
}

/* Dark Mode Overrides for Global Background */
body.dark-mode {
    background: transparent;
}

body.dark-mode::before {
    /* Brighter center to prove it's a gradient */
    background: radial-gradient(circle at 50% 0%, var(--theme-surface-soft) 0%, var(--theme-surface) 70%);
}

.action-card.selected {
    border-color: var(--theme-primary);
    background: var(--theme-primary) !important;
    box-shadow: 0 4px 15px rgba(0, 73, 125, 0.3);
}

.action-card.selected .card-label,
.action-card.selected .card-icon {
    color: var(--theme-on-primary) !important;
}

body.dark-mode .action-card.selected {
    background: var(--theme-primary) !important;
    color: var(--theme-on-primary) !important;
}

/* Language Toggle Pill */
.language-toggle-pill {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 99px;
    padding: 0;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    min-width: 100px;
    height: 38px;
    position: relative;
    overflow: hidden;
}

body.dark-mode .language-toggle-pill {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.pill-option {
    flex: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.pill-option.active {
    color: var(--theme-on-primary) !important;
}

.pill-selector {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 50%;
    background: var(--theme-primary);
    border-radius: 0;
    /* Rectangular fill within the rounded container */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.language-toggle-pill[data-flipped="true"] .pill-selector {
    transform: translateX(100%);
}

/* Logic for single language: fill the whole capsule */
.language-toggle-pill.single-lang .pill-selector {
    width: 100%;
}

.language-toggle-pill.single-lang .pill-option {
    color: var(--theme-on-primary) !important;
}

/* History Panel Styles (Overlay Version) */
.history-timestamp-panel {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--theme-surface-soft);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.card-body.blurred {
    filter: blur(8px) grayscale(0.2);
    opacity: 0.3;
    pointer-events: none;
}

.card-body {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.history-timestamp-panel.visible {
    display: block;
    animation: fadeInHistory 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.history-close:hover {
    color: var(--theme-primary);
}

.history-container {
    width: 100%;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 0 4px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    text-align: left;
    padding: 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--theme-primary);
    border-bottom: 1px solid var(--theme-border-soft);
    position: sticky;
    top: -1px;
    /* Avoid gap */
    background: transparent;
    z-index: 10;
}

.history-table td {
    padding: 8px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .history-table td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.col-num {
    color: var(--text-secondary);
    font-weight: 600;
    width: 24px;
}

.col-icon {
    width: 32px;
    text-align: center;
}

.history-row-icon {
    font-size: 18px;
    color: var(--theme-primary);
    opacity: 0.8;
}

.col-time {
    white-space: nowrap;
    font-weight: 500;
}

@keyframes fadeInHistory {
    from {
        opacity: 0;
        transform: translate(-50%, 15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* --- End Action Styles --- */

/* Theme Toggle Button Fix (Renamed to force update) */
.glass-toggle-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
}

.glass-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .glass-toggle-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

body.light-mode .glass-toggle-btn {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

/* --- SWIPE MODAL (Added Step 1208) --- */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.custom-modal-content {
    background: var(--bg-paper);
    width: 90%;
    max-width: 320px;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Daily Verse Card --- */
.daily-verse-card {
    background: var(--theme-surface-soft);
    /* Dark/Soft background */
    border-radius: 24px;
    padding: 32px 24px;
    margin: 24px auto;
    text-align: center;
    max-width: 500px;
    width: 100%;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

body.dark-mode .daily-verse-card {
    background: #1e293b;
    /* Dark Slate for contrast */
    border-color: rgba(255, 255, 255, 0.1);
}

.verse-text {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-primary);
}

.verse-ref-pill {
    background: var(--theme-primary-soft);
    color: var(--theme-primary);
    padding: 10px 20px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

body.dark-mode .verse-ref-pill {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

.verse-ref-pill:hover {
    transform: scale(1.05);
}