/* ============================================================
   Verse Feed — Quran Verse Card Feed System
   ============================================================
   Brand: Quranic Insights | by eBlessings
   Design tokens (v2 — Premium):
     --feed-bg          #f9f3eb
     --card-bg          #ffffff
     --card-hover-bg    linear-gradient(135deg, #ffffff 0%, #fefcf8 100%)
     --gold             #c9a84c
     --gold-light       rgba(201, 168, 76, 0.08)
     --gold-border      rgba(201, 168, 76, 0.25)
     --emerald          #0d5c3a
     --emerald-light    rgba(13, 92, 58, 0.06)
     --sepia            #5a4a3a
     --muted            #8B7355
     --arabic-font      'Amiri Quran', 'Scheherazade New', 'Amiri', serif
     --body-font        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif
     --purple           #8E44AD

   Cross-browser: vendor prefixes for Safari/WebKit, Firefox.
   iOS safe area: env(safe-area-inset-bottom) for notch devices.
   ============================================================ */

/* iOS safe-area viewport */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .verse-feed {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }
}

/* Vendor prefix fallbacks for content-visibility (Chrome 85+, no Firefox/Safari) */
@supports not (content-visibility: auto) {
    .feed-card {
        /* Fallback: no paint optimization, just render all */
        contain: layout style;
    }
}


/* ============================================================
   1. FEED CONTAINER
   ============================================================ */

.verse-feed {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 120px;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}


/* ============================================================
   2. FEED HEADER (sticky controls)
   ============================================================ */

.feed-header {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fdf8f0;
    padding: 4px 12px 4px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.12);
    margin-bottom: 12px;
    -webkit-backdrop-filter: blur(8px); /* Safari glassmorphism */
    backdrop-filter: blur(8px);
}

.feed-sura-title {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: #5a4a3a;
    margin: 0;
    padding: 10px 0 2px;
    line-height: 1.3;
}

.feed-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.feed-view-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(180, 160, 120, 0.3);
    flex-shrink: 0;
}

.feed-view-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    color: #8B7355;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    line-height: 1.4;
}

.feed-view-btn:hover {
    background: rgba(13, 92, 58, 0.06);
    color: #5a4a3a;
}

.feed-view-btn.active {
    background: #0d5c3a;
    color: #fff;
}

.feed-learning-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: #8B7355;
    flex-shrink: 0;
}

.feed-learning-toggle .form-check-input:checked {
    background-color: #0d5c3a;
    border-color: #0d5c3a;
}

.feed-progress {
    font-size: 0.72rem;
    color: #8B7355;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Play Surah button */
.feed-play-surah-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1.5px solid #0d5c3a;
    background: transparent;
    color: #0d5c3a;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.feed-play-surah-btn:hover {
    background: rgba(13, 92, 58, 0.08);
    border-color: #0b7a4a;
}

.feed-play-surah-btn:active {
    transform: scale(0.96);
}

/* Learning mode group */
.feed-learning-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.feed-learning-group .fas {
    color: #8B7355;
}

.feed-learning-switch {
    margin-bottom: 0;
}

.feed-learning-switch .form-check-input {
    width: 32px;
    height: 16px;
    cursor: pointer;
    border-color: rgba(180, 160, 120, 0.4);
}

.feed-learning-switch .form-check-input:checked {
    background-color: #8E44AD;
    border-color: #8E44AD;
}

.feed-learning-switch .form-check-label {
    font-size: 0.7rem;
    color: #8B7355;
    font-weight: 500;
    user-select: none;
}


/* ============================================================
   3. VERSE CARD (collapsed state) — PREMIUM REDESIGN
   ============================================================ */

.feed-card {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(180, 160, 120, 0.13);
    border-radius: 20px;
    margin-bottom: 16px;
    overflow: hidden;
    -webkit-transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transition: box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
                0 4px 12px rgba(90, 74, 58, 0.03);
    content-visibility: auto;
    contain-intrinsic-size: 0 240px;
}

/* Left accent stripe — Maslow need color set via inline style on ::before
   Uses CSS custom property --maslow-color (fallback: gold) */
.feed-card::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--maslow-color, rgba(201, 168, 76, 0.3));
    opacity: 0.6;
    -webkit-transition: opacity 0.3s ease, width 0.3s ease;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.feed-card:hover::before {
    opacity: 1;
    width: 4px;
}

.feed-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
                0 8px 32px rgba(90, 74, 58, 0.07),
                0 0 0 1px rgba(201, 168, 76, 0.08);
    border-color: rgba(201, 168, 76, 0.22);
    background: linear-gradient(135deg, #ffffff 0%, #fefcf8 100%);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
}

/* Active scroll position — subtle gold left glow */
.feed-card.feed-card-active {
    border-color: rgba(201, 168, 76, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
                0 8px 32px rgba(90, 74, 58, 0.07);
}

.feed-card.feed-card-active::before {
    opacity: 1;
    width: 4px;
    background: #c9a84c;
}

/* Audio playing state — emerald pulsing left border + glow */
.feed-card.active-playing {
    border-color: rgba(13, 92, 58, 0.2);
    box-shadow: 0 2px 8px rgba(13, 92, 58, 0.06),
                0 8px 32px rgba(13, 92, 58, 0.1),
                0 0 0 1px rgba(13, 92, 58, 0.05);
}

.feed-card.active-playing::before {
    opacity: 1;
    width: 4px;
    background: #0d5c3a;
    animation: feed-accent-pulse 2s ease-in-out infinite;
}

@keyframes feed-accent-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ============================================================
   4. CARD HEADER — PREMIUM REDESIGN
   ============================================================ */

.feed-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 0;
    gap: 10px;
}

/* Header sub-groups (left = ref + maslow label, right = buttons) */
.feed-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.feed-card-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Ref pill: larger, gold frame with inner glow, serif font */
.feed-card-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 30px;
    padding: 0 13px;
    border: 1.5px solid #c9a84c;
    border-radius: 15px;
    background: rgba(201, 168, 76, 0.06);
    box-shadow: inset 0 0 6px rgba(201, 168, 76, 0.1),
                0 1px 3px rgba(201, 168, 76, 0.08);
    font-family: 'Amiri', serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #5a4a3a;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* Maslow label: tiny colored text (replaces the old dot) */
.feed-card-maslow-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    padding: 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    /* Color is set via inline style in Python */
}

/* Legacy maslow dot (fallback for older card builders) */
.feed-card-maslow-dot {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
    padding: 2px 0;
    flex-shrink: 0;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
}

/* Legacy spacer (fallback for older card builders) */
.feed-card-header-spacer {
    flex: 1;
}

/* Buttons: ghost style with refined hover, smooth transitions */
.feed-card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(180, 160, 120, 0.18);
    background: transparent;
    color: #a09080;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    font-size: 0.72rem;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-shrink: 0;
}

.feed-card-btn:hover {
    border-color: rgba(201, 168, 76, 0.4);
    background: rgba(201, 168, 76, 0.06);
    color: #5a4a3a;
    -webkit-transform: scale(1.08);
    transform: scale(1.08);
}

.feed-card-btn:active {
    -webkit-transform: scale(0.95);
    transform: scale(0.95);
}

/* Bookmarked: gold fill animation */
.feed-card-btn.feed-bookmarked {
    color: #c9a84c;
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.1);
    animation: feed-bookmark-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Play button: emerald ghost with pulse when active */
.feed-card-btn.feed-play-btn {
    border-color: rgba(13, 92, 58, 0.25);
    color: #0d5c3a;
}

.feed-card-btn.feed-play-btn:hover {
    border-color: rgba(13, 92, 58, 0.4);
    background: rgba(13, 92, 58, 0.06);
    color: #0d5c3a;
}

/* Playing state pulse for the play button itself */
.active-playing .feed-card-btn.feed-play-btn {
    animation: feed-pulse-play 2s ease-in-out infinite;
    border-color: #0d5c3a;
    background: rgba(13, 92, 58, 0.08);
}

/* Expand button: smooth rotation */
.feed-expand-btn {
    -webkit-transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-card.expanded .feed-expand-btn {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}


/* ============================================================
   5. CARD BODY — PREMIUM REDESIGN
   ============================================================ */

.feed-card-body {
    padding: 8px 24px 10px;
    position: relative;
}

/* Subtle bottom fade when card is collapsed (hides content cut-off) */
.feed-card:not(.expanded) .feed-card-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 16px;
    background: linear-gradient(to top, #ffffff, transparent);
    pointer-events: none;
    opacity: 0.6;
}

/* Bismillah: refined with subtle ornamental feel */
.feed-card-bismillah {
    text-align: center;
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.35rem;
    color: #0d5c3a;
    padding: 10px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(13, 92, 58, 0.08);
    letter-spacing: 0.5px;
}

/* Arabic text: THE STAR — larger, more breathing room, text-shadow depth */
.feed-card-arabic {
    text-align: center;
    font-family: 'Amiri Quran', 'Scheherazade New', 'Amiri', serif;
    font-size: 2rem;
    line-height: 2.4;
    color: #1a1410;
    direction: rtl;
    padding: 16px 0 12px;
    word-spacing: 8px;
    text-shadow: 0 1px 2px rgba(90, 74, 58, 0.06);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Verse ornament: decorative gold circle with halo ring */
.feed-card-ornament {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #c9a84c;
    color: #b8933f;
    font-family: 'Amiri', serif;
    font-size: 0.74rem;
    font-weight: 700;
    margin: 0 auto;
    background: rgba(201, 168, 76, 0.04);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.06),
                0 0 0 6px rgba(201, 168, 76, 0.03),
                inset 0 0 4px rgba(201, 168, 76, 0.08);
    -webkit-transition: box-shadow 0.3s ease;
    transition: box-shadow 0.3s ease;
}

.feed-card:hover .feed-card-ornament {
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1),
                0 0 0 7px rgba(201, 168, 76, 0.05),
                inset 0 0 6px rgba(201, 168, 76, 0.12);
}

/* Translation: clean, left-aligned, NOT italic, with gold left accent */
.feed-card-translation {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #4a5568;
    padding: 10px 0 10px 14px;
    font-style: normal;
    font-weight: 400;
    text-align: left;
    position: relative;
    border-left: 2px solid rgba(201, 168, 76, 0.2);
    margin-left: 2px;
}

/* Attribution: subtle right-aligned */
.feed-card-attribution {
    text-align: right;
    font-size: 0.72rem;
    color: #a09080;
    padding: 2px 0 4px;
    font-style: italic;
    letter-spacing: 0.02em;
}


/* ============================================================
   6. CARD TAGS (footer strip) — PREMIUM REDESIGN
   ============================================================ */

.feed-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 20px 12px;
    border-top: 1px solid rgba(180, 160, 120, 0.06);
}

.feed-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
    letter-spacing: 0.02em;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

/* Maslow tag: filled background with need color at low opacity */
.feed-tag-maslow {
    border-color: currentColor;
    background: currentColor;
    /* The text color inside is set inline; this uses it as fill at low opacity.
       We use a trick: set bg to currentColor with a pseudo-element overlay. */
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.feed-tag-maslow::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #ffffff;
    opacity: 0.88;
    z-index: 0;
}

.feed-tag-maslow > * {
    position: relative;
    z-index: 1;
}

/* Emotion tag: warm gold with icon */
.feed-tag-emotion {
    border-color: rgba(201, 168, 76, 0.25);
    color: #8B7355;
    background: rgba(201, 168, 76, 0.05);
}

.feed-tag-emotion:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: rgba(201, 168, 76, 0.4);
}

/* Character tag: linked style with hover underline */
.feed-tag-character {
    border-color: rgba(180, 160, 120, 0.2);
    color: #5a4a3a;
    background: rgba(180, 160, 120, 0.04);
    cursor: pointer;
    text-decoration: none;
}

.feed-tag-character:hover {
    border-color: #c9a84c;
    color: #5a4a3a;
    background: rgba(201, 168, 76, 0.06);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Priority tag: colored by priority level */
.feed-tag-pri { font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.55rem; }
.feed-tag-pri-highest { border-color: #8B0000; color: #8B0000; background: rgba(139, 0, 0, 0.06); }
.feed-tag-pri-high { border-color: #DC143C; color: #DC143C; background: rgba(220, 20, 60, 0.06); }
.feed-tag-pri-medium { border-color: #c9a84c; color: #8B7355; background: rgba(201, 168, 76, 0.06); }
.feed-tag-pri-low { border-color: #27AE60; color: #27AE60; background: rgba(39, 174, 96, 0.06); }
.feed-tag-pri-lowest { border-color: #95A5A6; color: #95A5A6; background: rgba(149, 165, 166, 0.06); }

/* Nafs level tag: purple family */
.feed-tag-nafs {
    border-color: rgba(142, 68, 173, 0.2);
    color: #7B4DAB;
    background: rgba(142, 68, 173, 0.04);
    font-style: italic;
}

/* Scene mood tag: warm muted */
.feed-tag-scene {
    border-color: rgba(180, 160, 120, 0.2);
    color: #8B7355;
    background: rgba(249, 243, 235, 0.5);
}


/* ============================================================
   7. CARD DRAWER (expanded content) — PREMIUM REDESIGN
   ============================================================ */

.feed-card-drawer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    -webkit-transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        opacity 0.35s ease 0.05s,
                        padding 0.5s ease,
                        transform 0.35s ease 0.05s;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease 0.05s,
                padding 0.5s ease,
                transform 0.35s ease 0.05s;
    padding: 0 24px;
    border-top: 0 solid transparent;
}

.feed-card.expanded .feed-card-drawer {
    max-height: 3000px;
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
    padding: 16px 24px 20px;
    border-top-width: 1px;
    border-top-color: rgba(201, 168, 76, 0.12);
}

.drawer-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(201, 168, 76, 0.12);
}

.drawer-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.drawer-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #a09080;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drawer-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(201, 168, 76, 0.15), transparent);
}


/* ============================================================
   8. DRAWER: TRANSLITERATION — PREMIUM REDESIGN
   ============================================================ */

.drawer-transliteration {
    font-style: italic;
    color: #7B4DAB;
    font-size: 0.92rem;
    line-height: 1.7;
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.04) 0%, rgba(142, 68, 173, 0.07) 100%);
    border-radius: 12px;
    border: 1px solid rgba(142, 68, 173, 0.08);
}


/* ============================================================
   9. DRAWER: WORD-BY-WORD TABLE — PREMIUM REDESIGN
   ============================================================ */

.drawer-wbw-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(180, 160, 120, 0.1);
}

.drawer-wbw-table th {
    color: #a09080;
    font-weight: 700;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.12);
    background: rgba(249, 243, 235, 0.5);
}

.drawer-wbw-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.06);
    -webkit-transition: background 0.15s ease;
    transition: background 0.15s ease;
}

/* Alternating row backgrounds */
.drawer-wbw-table tr:nth-child(even) td {
    background: rgba(249, 243, 235, 0.35);
}

.drawer-wbw-table tr:last-child td {
    border-bottom: none;
}

.drawer-wbw-table tr:hover td {
    background: rgba(201, 168, 76, 0.04);
}

.drawer-wbw-table .wbw-ar {
    font-family: 'Amiri', serif;
    font-size: 1.15rem;
    direction: rtl;
    text-align: right;
    color: #1a1410;
    min-width: 80px;
}

.drawer-wbw-table .wbw-tr {
    font-style: italic;
    color: #7B4DAB;
}

.drawer-wbw-table .wbw-en {
    color: #4a5568;
}

.drawer-wbw-table .wbw-root {
    color: #a09080;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
}

.drawer-wbw-table .wbw-pos {
    color: #a09080;
    font-size: 0.66rem;
}

/* Learning mode: click-through highlighting */
.drawer-wbw-table td.wbw-active {
    background: rgba(201, 168, 76, 0.12);
    box-shadow: inset 0 0 0 2px rgba(201, 168, 76, 0.25);
    border-radius: 6px;
}


/* ============================================================
   10. DRAWER: MASLOW MINI-BARS — PREMIUM REDESIGN
   ============================================================ */

.drawer-needs {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px 0;
}

.drawer-need-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-need-label {
    width: 60px;
    font-size: 0.66rem;
    font-weight: 600;
    color: #a09080;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-transform: capitalize;
}

.drawer-need-bar {
    flex: 1;
    height: 6px;
    background: rgba(180, 160, 120, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.drawer-need-fill {
    height: 100%;
    border-radius: 3px;
    -webkit-transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Each fill gets its own gradient via inline style; this adds a subtle sheen */
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    background-blend-mode: overlay;
}

.drawer-need-val {
    width: 18px;
    font-size: 0.64rem;
    font-weight: 700;
    text-align: right;
    color: #8B7355;
}


/* ============================================================
   11. DRAWER: PSYCHE BADGES — PREMIUM REDESIGN
   ============================================================ */

.drawer-psyche-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.drawer-psyche-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.66rem;
    font-weight: 600;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    /* Each badge has its own accent color via inline style */
    background: rgba(255, 255, 255, 0.6);
}

.drawer-psyche-badge:hover {
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.drawer-psyche-badge .badge-label {
    font-size: 0.58rem;
    color: #a09080;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* ============================================================
   12. DRAWER: SCENE — PREMIUM REDESIGN
   ============================================================ */

.drawer-scene {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.drawer-scene-chip {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.68rem;
    background: rgba(249, 243, 235, 0.8);
    color: #5a4a3a;
    border: 1px solid rgba(180, 160, 120, 0.1);
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.drawer-scene-chip:hover {
    background: rgba(201, 168, 76, 0.06);
    border-color: rgba(201, 168, 76, 0.2);
}

.drawer-scene-chip i {
    font-size: 0.6rem;
    margin-right: 4px;
    color: #c9a84c;
    opacity: 0.7;
}

.drawer-sounds {
    font-style: italic;
    font-size: 0.76rem;
    color: #a09080;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(249, 243, 235, 0.4);
    border-radius: 8px;
    line-height: 1.5;
}


/* ============================================================
   13. DRAWER: ENRICHMENT (collapsible sections) — PREMIUM REDESIGN
   ============================================================ */

.drawer-enrichment-item {
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(249, 243, 235, 0.4);
    border: 1px solid rgba(180, 160, 120, 0.06);
    overflow: hidden;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.drawer-enrichment-item:last-child {
    margin-bottom: 0;
}

.drawer-enrichment-item:hover {
    background: rgba(249, 243, 235, 0.6);
    border-color: rgba(180, 160, 120, 0.1);
}

.drawer-enrichment-item.open {
    background: rgba(249, 243, 235, 0.6);
    border-color: rgba(201, 168, 76, 0.12);
}

.drawer-enrichment-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a4a3a;
    padding: 8px 12px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.drawer-enrichment-toggle:hover {
    color: #3a2a1a;
}

.drawer-enrichment-toggle i {
    font-size: 0.6rem;
    color: #c9a84c;
    -webkit-transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 12px;
    text-align: center;
}

.drawer-enrichment-item.open .drawer-enrichment-toggle i {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
}

.drawer-enrichment-content {
    max-height: 0;
    overflow: hidden;
    -webkit-transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                        opacity 0.25s ease;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #4a5568;
    padding: 0 12px 0 32px;
    opacity: 0;
}

.drawer-enrichment-item.open .drawer-enrichment-content {
    max-height: 500px;
    padding-top: 0;
    padding-bottom: 10px;
    opacity: 1;
}


/* ============================================================
   14. DRAWER: AUDIO BUTTONS — PREMIUM REDESIGN
   ============================================================ */

.drawer-audio {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-audio .audio-trigger-btn {
    height: 34px;
    padding: 0 18px;
    border-radius: 17px;
    font-size: 0.75rem;
    font-weight: 600;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(13, 92, 58, 0.04) 0%, rgba(13, 92, 58, 0.08) 100%);
    border: 1.5px solid rgba(13, 92, 58, 0.2);
    color: #0d5c3a;
}

.drawer-audio .audio-trigger-btn:hover {
    background: linear-gradient(135deg, rgba(13, 92, 58, 0.08) 0%, rgba(13, 92, 58, 0.14) 100%);
    border-color: rgba(13, 92, 58, 0.35);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 92, 58, 0.1);
}

.drawer-audio .audio-trigger-btn:active {
    -webkit-transform: scale(0.97);
    transform: scale(0.97);
}


/* ============================================================
   15. DRAWER: ACTIONS ROW — PREMIUM REDESIGN
   ============================================================ */

.drawer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.drawer-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #8B7355;
    border: 1px solid rgba(180, 160, 120, 0.15);
    background: rgba(249, 243, 235, 0.3);
    cursor: pointer;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-action-btn:hover {
    border-color: rgba(201, 168, 76, 0.3);
    color: #5a4a3a;
    background: rgba(201, 168, 76, 0.06);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.drawer-action-btn:active {
    -webkit-transform: scale(0.97);
    transform: scale(0.97);
}

.drawer-action-btn i {
    font-size: 0.64rem;
    opacity: 0.7;
}


/* ============================================================
   16. LEARNING MODE — PREMIUM REDESIGN
   ============================================================ */

.verse-feed.learning-mode .feed-card-translation {
    -webkit-filter: blur(8px);
    filter: blur(8px);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-transition: -webkit-filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; /* for ::after positioning */
}

.verse-feed.learning-mode .feed-card-translation.revealed {
    -webkit-filter: none;
    filter: none;
    cursor: default;
}

.verse-feed.learning-mode .feed-card-translation::after {
    content: 'Tap to reveal';
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    font-size: 0.72rem;
    color: #a09080;
    font-style: normal;
    font-weight: 500;
    opacity: 1;
    pointer-events: none;
    letter-spacing: 0.03em;
}

.verse-feed.learning-mode .feed-card-translation.revealed::after {
    opacity: 0;
}

/* Auto-show transliteration in learning mode */
.verse-feed.learning-mode .drawer-transliteration-peek {
    display: block;
}

.feed-repeat-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(180, 160, 120, 0.2);
    border-radius: 14px;
    padding: 3px 8px;
    font-size: 0.7rem;
    background: rgba(249, 243, 235, 0.3);
}

.feed-repeat-control button {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #a09080;
    cursor: pointer;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.feed-repeat-control button:hover {
    background: rgba(201, 168, 76, 0.1);
    color: #5a4a3a;
}

.feed-repeat-count {
    min-width: 16px;
    text-align: center;
    font-weight: 700;
    color: #5a4a3a;
}


/* ============================================================
   17. FEED SENTINEL (infinite scroll trigger)
   ============================================================ */

.feed-sentinel {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-sentinel-loading {
    font-size: 0.78rem;
    color: #8B7355;
}

.feed-sentinel-loading i {
    animation: feed-spin 1s linear infinite;
    margin-right: 6px;
}

@keyframes feed-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   17b. CARD FLASH ANIMATION (scroll-to-verse highlight)
   Premium: golden ripple effect
   ============================================================ */

.feed-card-flash {
    animation: feed-flash 2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes feed-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.5);
    }
    15% {
        box-shadow: 0 0 0 6px rgba(201, 168, 76, 0.3),
                    0 4px 20px rgba(201, 168, 76, 0.15);
        border-color: #c9a84c;
    }
    40% {
        box-shadow: 0 0 0 10px rgba(201, 168, 76, 0.0),
                    0 4px 20px rgba(201, 168, 76, 0.08);
    }
    100% {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04),
                    0 4px 12px rgba(90, 74, 58, 0.03);
    }
}


/* ============================================================
   17b2. NEW KEYFRAME ANIMATIONS
   ============================================================ */

/* Gentle emerald pulse for active audio play button */
@keyframes feed-pulse-play {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(13, 92, 58, 0.3);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(13, 92, 58, 0.0);
    }
}

/* Scale bounce when bookmarking */
@keyframes feed-bookmark-pop {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    30% {
        -webkit-transform: scale(1.3);
        transform: scale(1.3);
    }
    50% {
        -webkit-transform: scale(0.9);
        transform: scale(0.9);
    }
    70% {
        -webkit-transform: scale(1.08);
        transform: scale(1.08);
    }
    100% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}


/* ============================================================
   17c. CONTINUE READING BANNER
   ============================================================ */

.feed-continue-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.06) 0%, rgba(13, 92, 58, 0.04) 100%);
    border: 1px solid rgba(201, 168, 76, 0.18);
    border-radius: 16px;
    cursor: pointer;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-continue-banner:hover {
    border-color: rgba(201, 168, 76, 0.4);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.1) 0%, rgba(13, 92, 58, 0.06) 100%);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.08);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
}

.feed-continue-banner i {
    color: #c9a84c;
    font-size: 1rem;
}

.feed-continue-text {
    flex: 1;
    font-size: 0.82rem;
    color: #5a4a3a;
}

.feed-continue-text strong {
    color: #0d5c3a;
}

.feed-continue-dismiss {
    border: none;
    background: transparent;
    color: #a09080;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    -webkit-transition: all 0.15s ease;
    transition: all 0.15s ease;
}

.feed-continue-dismiss:hover {
    background: rgba(180, 160, 120, 0.12);
    color: #5a4a3a;
}


/* ============================================================
   17d. SURA TRANSITION CARDS — PREMIUM REDESIGN
   ============================================================ */

/* Shared base */
.sura-trans-card {
    margin: 20px 0;
    border-radius: 20px;
    overflow: hidden;
}

/* --- End-of-sura transition (rich card) --- */
.sura-trans-end {
    background: linear-gradient(135deg, #fdf8f0 0%, #f5ede0 60%, #f0e8d8 100%);
    border: 1.5px solid rgba(201, 168, 76, 0.2);
    padding: 28px 28px;
    text-align: center;
    position: relative;
}

/* Islamic geometric pattern ornament via CSS */
.sura-trans-end::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(201, 168, 76, 0.15) 10%,
        rgba(201, 168, 76, 0.4) 30%,
        #c9a84c 50%,
        rgba(201, 168, 76, 0.4) 70%,
        rgba(201, 168, 76, 0.15) 90%,
        transparent 100%
    );
    border-radius: 2px;
}

.sura-trans-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

/* Centered ornamental divider */
.sura-trans-divider {
    width: 80px;
    height: 1px;
    background: transparent;
    margin: 4px auto 20px;
    position: relative;
}

.sura-trans-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a84c, transparent);
}

.sura-trans-divider::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    -webkit-transform: translateX(-50%) rotate(45deg);
    transform: translateX(-50%) rotate(45deg);
    width: 7px;
    height: 7px;
    border: 1px solid #c9a84c;
    background: #fdf8f0;
}

.sura-trans-nav {
    display: flex;
    align-items: stretch;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Nav buttons: card-like with lift on hover */
.sura-trans-btn {
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1.5px solid rgba(180, 160, 120, 0.2);
    background: #fff;
    cursor: pointer;
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    min-width: 150px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sura-trans-btn:hover {
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.1),
                0 2px 6px rgba(0, 0, 0, 0.04);
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
}

.sura-trans-btn:active {
    -webkit-transform: scale(0.98) translateY(0);
    transform: scale(0.98) translateY(0);
}

.sura-trans-btn i {
    color: #c9a84c;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sura-trans-btn-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.sura-trans-btn-num {
    font-size: 0.65rem;
    color: #a09080;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sura-trans-btn-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #5a4a3a;
    font-family: 'Amiri', serif;
}

/* Next sura: PROMINENT — filled emerald bg, white text */
.sura-trans-next {
    border-color: #0d5c3a;
    background: linear-gradient(135deg, #0d5c3a 0%, #0a7a4a 100%);
    box-shadow: 0 2px 8px rgba(13, 92, 58, 0.15);
}

.sura-trans-next:hover {
    border-color: #0a7a4a;
    background: linear-gradient(135deg, #0a7a4a 0%, #0d8d52 100%);
    box-shadow: 0 6px 20px rgba(13, 92, 58, 0.2),
                0 2px 8px rgba(0, 0, 0, 0.06);
}

.sura-trans-next i {
    color: rgba(255, 255, 255, 0.8);
}

.sura-trans-next .sura-trans-btn-num {
    color: rgba(255, 255, 255, 0.6);
}

.sura-trans-next .sura-trans-btn-name {
    color: #ffffff;
}

.sura-trans-next .sura-trans-btn-text {
    text-align: right;
}

/* --- Start-of-sura transition (compact back link) --- */
.sura-trans-start {
    text-align: center;
    padding: 8px 0;
}

.sura-trans-back-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1px solid rgba(180, 160, 120, 0.18);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    color: #a09080;
    font-size: 0.78rem;
    cursor: pointer;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.sura-trans-back-btn:hover {
    border-color: rgba(201, 168, 76, 0.3);
    color: #5a4a3a;
    background: rgba(201, 168, 76, 0.06);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
}

/* Legacy end marker (fallback) */
.feed-end-marker {
    text-align: center;
    padding: 28px 16px;
    color: #a09080;
    font-size: 0.82rem;
    font-style: italic;
}


/* ============================================================
   17d2. INLINE SURA PICKER (feed header)
   ============================================================ */

.feed-sura-picker-wrap {
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 0;
    max-width: 200px;
}

.feed-sura-picker-wrap .fas {
    flex-shrink: 0;
}

.feed-sura-picker-dd {
    min-width: 120px;
}

/* Dash dropdown overrides for sura picker */
.feed-sura-picker-dd .Select-control {
    height: 28px;
    min-height: 28px;
    border: 1px solid rgba(13, 92, 58, 0.25);
    border-radius: 8px;
    background: rgba(13, 92, 58, 0.03);
}

.feed-sura-picker-dd .Select-value-label,
.feed-sura-picker-dd .Select-placeholder {
    font-size: 0.75rem;
    color: #0d5c3a;
    line-height: 28px;
}

.feed-sura-picker-dd .Select-input > input {
    font-size: 0.75rem;
}

.feed-sura-picker-dd .Select-menu-outer {
    z-index: 10000;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
}

.feed-sura-picker-dd .Select-option {
    font-size: 0.75rem;
    padding: 6px 10px;
}

.feed-sura-picker-dd .Select-option.is-focused {
    background: rgba(13, 92, 58, 0.08);
}

.feed-sura-picker-dd .Select-option.is-selected {
    background: rgba(13, 92, 58, 0.15);
    font-weight: 600;
}


/* ============================================================
   17e. VERSE NOTES (in drawer) — PREMIUM REDESIGN
   ============================================================ */

.drawer-notes-textarea {
    width: 100%;
    min-height: 64px;
    max-height: 200px;
    padding: 10px 14px;
    border: 1.5px solid rgba(180, 160, 120, 0.15);
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #5a4a3a;
    background: rgba(249, 243, 235, 0.4);
    resize: vertical;
    outline: none;
    -webkit-transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.drawer-notes-textarea:focus {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.drawer-notes-textarea::placeholder {
    color: #c0b090;
    font-style: italic;
}


/* ============================================================
   17f. RESPONSIVE: below 1024px (tablets)
   ============================================================ */

@media (max-width: 1024px) {
    .verse-feed {
        max-width: 640px;
    }

    .feed-card-arabic {
        font-size: 1.85rem;
        line-height: 2.3;
    }

    /* Controls: hide lang/translator on tablets in feed mode too */
    .feed-controls-row .feed-globe-icon,
    .feed-controls-row .feed-lang-wrap,
    .feed-controls-row .feed-translator-wrap,
    .feed-controls-row .feed-lang-divider {
        display: none !important;
    }
}


/* ============================================================
   18. RESPONSIVE: below 768px
   ============================================================ */

@media (max-width: 768px) {

    /* --- Feed header: compact 2-row layout --- */
    .feed-header {
        padding: 4px 10px 4px;
        margin-bottom: 8px;
    }

    .feed-sura-title {
        font-size: 1.15rem;
        padding: 6px 0 0;
    }

    /* Hide globe icon + language/translator dropdowns in feed mode on mobile. */
    .feed-controls-row .feed-globe-icon,
    .feed-controls-row .feed-lang-wrap,
    .feed-controls-row .feed-translator-wrap,
    .feed-controls-row .feed-lang-divider {
        display: none !important;
    }

    /* Controls row: tight single line with remaining items */
    .feed-controls-row {
        gap: 6px;
        padding: 4px 0;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    /* Sura info strip compact */
    .sura-info-strip {
        font-size: 0.72rem;
        padding: 3px 0;
    }

    /* Cards: slightly tighter but keep rounded feel */
    .feed-card {
        border-radius: 18px;
        margin-bottom: 12px;
    }

    .feed-card-arabic {
        font-size: 1.7rem;
        line-height: 2.2;
    }

    .feed-card-body {
        padding: 8px 16px 6px;
    }

    .feed-card-header {
        padding: 10px 14px 0;
    }

    .feed-card-tags {
        padding: 6px 14px 10px;
        gap: 5px;
    }

    .feed-tag {
        font-size: 0.6rem;
        padding: 2px 8px;
    }

    /* Hide WBW columns on tablet */
    .drawer-wbw-table .wbw-root,
    .drawer-wbw-table .wbw-pos {
        display: none;
    }

    /* Play Surah button: compact */
    .feed-play-surah-btn {
        height: 26px;
        padding: 0 10px;
        font-size: 0.68rem;
    }

    /* Learning group: compact */
    .feed-learning-group {
        gap: 3px;
    }

    .feed-learning-switch .form-check-label {
        font-size: 0.65rem;
    }

    /* Bottom padding: audio player bar only (56px) since vc bar is hidden in feed */
    .verse-feed {
        padding-bottom: 72px;
    }

    /* Transition cards: compact on tablet */
    .sura-trans-end {
        padding: 20px 18px;
    }

    .sura-trans-btn {
        padding: 10px 16px;
        min-width: 130px;
    }

    /* Sura picker: slightly narrower */
    .feed-sura-picker-wrap {
        max-width: 170px;
    }

    /* Drawer: narrower padding on tablet */
    .feed-card.expanded .feed-card-drawer {
        padding: 14px 16px 16px;
    }

    /* Audio buttons: full width on tablet */
    .drawer-audio {
        flex-direction: column;
    }

    .drawer-audio .audio-trigger-btn {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================================
   19. RESPONSIVE: below 480px (small phones: 360-412px)
   ============================================================ */

@media (max-width: 480px) {
    .verse-feed {
        padding: 0 4px 68px; /* near full-bleed, audio player + margin */
    }

    .feed-header {
        padding: 3px 6px 3px;
        margin-bottom: 4px;
    }

    .feed-sura-title {
        font-size: 1.05rem;
        padding: 4px 0 0;
    }

    /* Controls row: super compact */
    .feed-controls-row {
        gap: 4px;
        padding: 3px 0;
    }

    /* Hide remaining dividers on small phones */
    .feed-controls-row .vc-action-divider {
        display: none !important;
    }

    /* View toggle: smaller */
    .feed-view-btn {
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    /* Play Surah: icon-only on very small screens */
    .feed-play-surah-btn .btn-label-text {
        display: none;
    }

    .feed-play-surah-btn {
        height: 24px;
        padding: 0 8px;
        font-size: 0.65rem;
        min-width: 0;
    }

    /* Learning toggle: hide label, icon + switch only */
    .feed-learning-switch .form-check-label {
        display: none;
    }

    /* Card sizing: full-bleed with just slight rounding */
    .feed-card {
        border-radius: 14px;
        margin-bottom: 10px;
        margin-left: 2px;
        margin-right: 2px;
    }

    .feed-card::before {
        top: 10px;
        bottom: 10px;
    }

    .feed-card-body {
        padding: 6px 12px 6px;
    }

    /* Arabic: still generous but scaled for phone */
    .feed-card-arabic {
        font-size: 1.5rem;
        line-height: 2.1;
        padding: 10px 0 8px;
        word-spacing: 6px;
    }

    .feed-card-translation {
        font-size: 0.88rem;
        padding: 8px 0 8px 10px;
        line-height: 1.7;
    }

    .feed-card-attribution {
        font-size: 0.7rem;
    }

    /* Card header: compact */
    .feed-card-header {
        padding: 8px 12px 0;
        gap: 6px;
    }

    .feed-card-btn {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .feed-card-ref {
        height: 26px;
        font-size: 0.78rem;
        min-width: 48px;
        padding: 0 9px;
    }

    /* Maslow label: truncate on small phones */
    .feed-card-maslow-label {
        max-width: 80px;
        font-size: 0.55rem;
    }

    .feed-card-ornament {
        width: 28px;
        height: 28px;
        font-size: 0.68rem;
    }

    /* Tags: compact pills */
    .feed-card-tags {
        padding: 4px 12px 8px;
        gap: 4px;
    }

    .feed-tag {
        font-size: 0.58rem;
        padding: 2px 7px;
    }

    /* Sura info strip */
    .sura-info-strip {
        font-size: 0.68rem;
    }

    /* Transition cards: stack buttons vertically on small phones */
    .sura-trans-end {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .sura-trans-nav {
        flex-direction: column;
        gap: 10px;
    }

    .sura-trans-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        min-width: 0;
        border-radius: 12px;
    }

    .sura-trans-next .sura-trans-btn-text {
        text-align: center;
    }

    .sura-trans-btn-name {
        font-size: 0.85rem;
    }

    /* Sura picker: compact on mobile */
    .feed-sura-picker-wrap {
        max-width: 140px;
    }

    .feed-sura-picker-dd {
        min-width: 100px;
    }

    /* Drawer: tighter on mobile */
    .feed-card.expanded .feed-card-drawer {
        padding: 12px 12px 14px;
    }

    .drawer-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .drawer-section-label {
        font-size: 0.63rem;
        margin-bottom: 8px;
    }

    /* Continue reading banner: compact */
    .feed-continue-banner {
        padding: 10px 12px;
        margin-bottom: 10px;
        gap: 8px;
        border-radius: 12px;
    }

    .feed-continue-text {
        font-size: 0.78rem;
    }

    /* Enrichment items: slightly less padding */
    .drawer-enrichment-toggle {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .drawer-enrichment-content {
        padding-left: 24px;
    }

    /* iOS safe area for bottom-bar devices */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .verse-feed {
            padding-bottom: calc(68px + env(safe-area-inset-bottom));
        }
    }
}


/* ============================================================
   19b. RESPONSIVE: landscape phones (short viewport)
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .feed-header {
        position: relative; /* un-sticky on landscape phones -- too little vertical space */
    }

    .feed-card-arabic {
        font-size: 1.3rem;
        line-height: 1.9;
        padding: 8px 0 6px;
    }

    .feed-card-translation {
        font-size: 0.82rem;
    }
}


/* ============================================================
   19c. RESPONSIVE: large desktop (1200px+)
   ============================================================ */

@media (min-width: 1200px) {
    .feed-card-arabic {
        font-size: 2.2rem;
        line-height: 2.5;
    }

    .feed-card-body {
        padding: 10px 28px 12px;
    }

    .feed-card-header {
        padding: 16px 24px 0;
    }
}


/* ============================================================
   20. PRINT
   ============================================================ */

@media print {
    .feed-header,
    .feed-card-header .feed-card-btn,
    .feed-card-drawer,
    .feed-card-tags,
    .feed-sentinel {
        display: none !important;
    }

    .feed-card {
        break-inside: avoid;
        border: none;
        box-shadow: none;
        margin-bottom: 20px;
    }

    .feed-card::before {
        display: none;
    }

    .feed-card-translation {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }
}
