/* ==========================================================================
   Voice Story Recording & QR Application - Global & Screen Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&family=Amiri:wght@400;700&family=Marcellus&family=Philosopher:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-parchment: #f7efe4;
    --card-bg: linear-gradient(180deg, rgba(255, 238, 220, 0.48) 0%, rgba(248, 218, 188, 0.56) 100%);
    
    /* Terracotta palette with authentic Golden/Amber borders */
    --terracotta-grad: linear-gradient(180deg, #c75b28 0%, #aa471c 55%, #923712 100%);
    --terracotta-hover: linear-gradient(180deg, #d36630 0%, #b54f21 55%, #9e3d16 100%);
    --btn-gold-border: #df9c4b;
    --btn-outline-border: #c2592d;
    --btn-outline-bg: rgba(253, 242, 230, 0.85);
    
    --gold-gradient: radial-gradient(circle at 35% 32%, #f5d3a5 0%, #e3b680 22%, #bf905b 54%, #9a6d3c 82%, #7c5025 100%);
    --gold-shadow: 0 10px 25px rgba(110, 65, 20, 0.36), 0 3px 8px rgba(60, 30, 8, 0.2);
    
    --card-border: #de8347;
    --text-dark: #2a1f18;
    --text-muted: #6e584c;
    
    --font-arabic: 'Cairo', 'Tajawal', 'Amiri', 'Marcellus', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: var(--font-arabic);
    --font-cta: var(--font-arabic);
    --font-primary: var(--font-arabic);
    --radius-pill: 9999px;
    --radius-btn: 14px;
    --radius-input: 12px;
    --radius-card: 22px;
    --shadow-card: 0 8px 28px rgba(160, 75, 30, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-serif);
    color: var(--text-dark);
    background-color: var(--bg-parchment);
    background-image: url('../branding/final_look.png');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    overflow-x: hidden;
}

body.lang-en {
    font-family: 'Marcellus', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.lang-ar {
    font-family: var(--font-arabic);
}

/* ==========================================================================
   Initial Page Splash Loader (Preloading background and assets)
   ========================================================================== */
.initial-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f7efe4;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.initial-page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-emblem {
    width: 140px;
    max-width: 45vw;
    height: auto;
    margin-bottom: 22px;
    animation: loaderPulse 1.6s ease-in-out infinite alternate;
    filter: drop-shadow(0 6px 18px rgba(184, 78, 34, 0.25));
}

@keyframes loaderPulse {
    0% { transform: scale(0.96); opacity: 0.88; }
    100% { transform: scale(1.04); opacity: 1; }
}

.loader-spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(194, 89, 45, 0.2);
    border-top-color: #c75b28;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}

.loader-text {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: #923712;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Language Switcher (EN / عربي)
   ========================================================================== */
.lang-switch-wrapper {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 99999;
    pointer-events: auto;
}

.btn-lang-toggle {
    background: rgba(255, 248, 238, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.8px solid #c75b28;
    border-radius: 9999px;
    padding: 7px 18px;
    min-height: 40px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 700;
    color: #8c3210;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(160, 75, 30, 0.22);
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-lang-toggle * {
    pointer-events: none;
}

.btn-lang-toggle:hover {
    background: #ffffff;
    border-color: #aa471c;
    color: #632005;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(160, 75, 30, 0.3);
}

.btn-lang-toggle:active {
    transform: scale(0.95);
}

.lang-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .lang-switch-wrapper {
        top: 14px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        z-index: 99999;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .btn-lang-toggle {
        padding: 6px 16px;
        font-size: 13.5px;
        min-height: 38px;
        box-shadow: 0 4px 14px rgba(160, 75, 30, 0.25);
    }
    /* On screens with the top center logo (Screens 2-6), place language toggle at bottom so it remains fully accessible and never covers the top emblem */
    body[data-screen="2"] .lang-switch-wrapper,
    body[data-screen="3"] .lang-switch-wrapper,
    body[data-screen="4"] .lang-switch-wrapper,
    body[data-screen="5"] .lang-switch-wrapper,
    body.screen-2-active .lang-switch-wrapper,
    body.screen-3-active .lang-switch-wrapper,
    body.screen-4-active .lang-switch-wrapper,
    body.screen-5-active .lang-switch-wrapper,
    body.page-listen .lang-switch-wrapper,
    body[data-screen="listen"] .lang-switch-wrapper {
        top: auto;
        bottom: 14px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* App Viewport Container */
.app-viewport {
    width: 100%;
    max-width: 680px;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

/* Screens */
.app-screen {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.app-screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-screen:not(.screen-landing) {
    margin-top: -50px;
}

/* Logos & Emblems */
.top-emblem-container {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.app-viewport > .top-emblem-container {
    margin-top: -50px;
}

.top-emblem {
    width: 128px;
    height: auto;
    max-width: 28vw;
    aspect-ratio: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(60, 30, 10, 0.16));
    display: block;
}

.screen-landing {
    padding: 0;
}

.screen-landing .hero-emblem {
    width: 285px;
    max-width: 80vw;
    height: auto;
    filter: drop-shadow(0 10px 24px rgba(60, 30, 10, 0.18));
    margin-top: 0;
    margin-bottom: 20px;
    transition: transform 0.4s ease;
}

@media (min-width: 1200px) {
    .top-emblem {
        width: 140px;
    }
}

@media (max-width: 768px) {
    .screen-landing .hero-emblem {
        width: 260px;
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .app-screen:not(.screen-landing),
    .app-viewport > .top-emblem-container {
        margin-top: -36px;
    }
    .screen-landing .hero-emblem {
        width: 230px;
        margin-bottom: 16px;
    }
    .top-emblem {
        width: 72px;
        margin-bottom: 6px;
    }
}

/* Main Card */
.content-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 610px;
    padding: 28px 28px 22px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

@media (max-width: 540px) {
    .content-card {
        padding: 22px 16px 18px 16px;
        border-radius: 20px;
    }
}

/* Card Header Information */
.card-header-meta {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-subtitle {
    font-family: var(--font-serif);
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 480px;
}

/* ==========================================================================
   BUTTON STYLES (Matching Reference Images with Amber/Gold Border)
   ========================================================================== */

/* Primary Terracotta Button with Gold/Amber Border */
.btn-terracotta {
    background: var(--terracotta-grad);
    color: #ffffff;
    border: 1.6px solid #e29e3a;
    border-radius: 16px;
    font-family: var(--font-cta);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.6px;
    padding: 8px 36px;
    min-height: 42px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(135, 48, 14, 0.35), inset 0 1px 1.5px rgba(255, 230, 180, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
}

.btn-terracotta:hover {
    background: var(--terracotta-hover);
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(135, 48, 14, 0.45), inset 0 1px 1.5px rgba(255, 240, 200, 0.6);
    border-color: #f0b04a;
}

.btn-terracotta:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(146, 55, 18, 0.3);
}

/* Secondary / Outline Button (Screen 3 Pause & Screen 4 Confirm/Upload) */
.btn-outline-terracotta {
    background: transparent;
    color: #1a1614;
    border: 1.6px solid #d9783e;
    border-radius: 14px;
    font-family: var(--font-cta);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.5px;
    padding: 8px 32px;
    min-height: 42px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: none;
    outline: none;
    text-decoration: none;
}

.btn-outline-terracotta:hover {
    background: rgba(217, 120, 62, 0.12);
    border-color: #c86325;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(146, 55, 18, 0.1);
}

.btn-outline-terracotta:active {
    transform: translateY(1px);
}

.btn-done {
    min-width: 140px;
}

.btn-pause {
    min-width: 145px;
    background: transparent;
    color: #1a1614;
    border: 1.6px solid #d9783e;
}

.btn-pause:hover {
    background: rgba(217, 120, 62, 0.12);
}

/* ==========================================================================
   Form Inputs (Screen 2) - Terracotta Capsule with Amber Border
   ========================================================================== */
.form-group-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.pill-input-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.pill-input {
    width: 100%;
    height: 48px;
    background: var(--terracotta-grad);
    border: 1.8px solid var(--btn-gold-border);
    border-radius: var(--radius-input);
    padding: 0 20px;
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 500;
    color: #ffffff;
    text-align: right !important;
    direction: rtl !important;
    unicode-bidi: plaintext;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22), 0 3px 6px rgba(140, 50, 15, 0.18);
    transition: all 0.2s ease;
}

.pill-input::placeholder {
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font-serif);
    font-weight: 400;
    text-align: right !important;
    direction: rtl !important;
}

/* English / LTR input & placeholder direction */
html[lang="en"] .pill-input,
body.lang-en .pill-input,
.pill-input[dir="ltr"] {
    text-align: left !important;
    direction: ltr !important;
}

html[lang="en"] .pill-input::placeholder,
body.lang-en .pill-input::placeholder,
.pill-input[dir="ltr"]::placeholder {
    text-align: left !important;
    direction: ltr !important;
}

/* Arabic / RTL input & placeholder direction */
html[lang="ar"] .pill-input,
body.lang-ar .pill-input,
.pill-input[dir="rtl"],
.pill-input:not([dir="ltr"]) {
    text-align: right !important;
    direction: rtl !important;
}

html[lang="ar"] .pill-input::placeholder,
body.lang-ar .pill-input::placeholder,
.pill-input[dir="rtl"]::placeholder,
.pill-input:not([dir="ltr"])::placeholder {
    text-align: right !important;
    direction: rtl !important;
}

.pill-input:focus {
    background: var(--terracotta-hover);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(223, 156, 75, 0.45);
}

.input-helper-text {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.length-notice {
    font-family: var(--font-serif);
    font-size: 14px;
    color: #786458;
    margin-top: 12px;
    font-weight: 500;
}

/* ==========================================================================
   Gold Microphone Button (Screen 2) - Matched to Client Design
   ========================================================================== */
.mic-btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 6px 0;
}

.btn-gold-mic {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: none;
    box-shadow: var(--gold-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    position: relative;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
}

.btn-gold-mic:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 32px rgba(110, 65, 20, 0.48), 0 5px 12px rgba(60, 30, 8, 0.25);
}

.btn-gold-mic:active {
    transform: scale(0.96);
    box-shadow: 0 5px 15px rgba(110, 65, 20, 0.4);
}

.mic-icon-svg {
    width: 54px;
    height: 54px;
    transition: transform 0.2s ease;
}

@media (max-width: 480px) {
    .btn-gold-mic {
        width: 96px;
        height: 96px;
    }
    .mic-icon-svg {
        width: 48px;
        height: 48px;
    }
}

/* ==========================================================================
   Recording Controls & Waveform (Screen 3)
   ========================================================================== */
.recording-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ba493e;
    color: #2a1b14;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 5px 20px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(186, 73, 62, 0.25);
    transition: all 0.3s ease;
}

.recording-badge.paused {
    background: #d88e28;
    color: #2a1b14;
    box-shadow: 0 2px 8px rgba(216, 142, 40, 0.25);
}

.recording-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #ff5248;
    box-shadow: 0 0 6px #ff5248;
    animation: pulseDot 1.2s infinite;
}

.recording-badge.paused .recording-dot {
    background-color: #ffe066;
    box-shadow: 0 0 6px #ffe066;
    animation: none;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px rgba(255, 82, 72, 0.8); }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.timer-display {
    font-family: var(--font-serif);
    font-size: 58px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #1a1614;
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .timer-display {
        font-size: 46px;
    }
}

/* Audio Visualizer Capsule */
.visualizer-capsule {
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: #0f0d0c;
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid #332b27;
}

.visualizer-canvas {
    width: 100%;
    height: 100%;
}

.recording-status-text {
    font-family: var(--font-serif);
    font-size: 17px;
    color: #4a684a;
    font-weight: 400;
    margin-bottom: 26px;
    letter-spacing: 0.3px;
}

/* Button Groups */
.actions-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .actions-row {
        gap: 16px;
    }
}

/* ==========================================================================
   Audio Preview Player (Screen 4 & Listen Page)
   ========================================================================== */
.preview-header-layout {
    width: 100%;
    max-width: 540px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0 auto 12px auto;
}

.preview-header-layout .card-header-meta {
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 400;
    margin-right: 0;
}

.preview-left-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 0;
}

.preview-title-text {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 400;
    color: var(--text-dark);
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: block;
}

.btn-play-preview-pill {
    padding: 6px 26px;
    font-size: 18px;
    min-height: 38px;
    border-radius: 14px;
    white-space: nowrap;
}

.custom-audio-player {
    width: 100%;
    max-width: 540px;
    background: #0f0d0c;
    border-radius: var(--radius-pill);
    padding: 11px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7), 0 6px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #332b26;
    margin: 20px 0 28px 0;
}

.player-btn-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #eb9d75 0%, #c45b2e 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.player-btn-circle:hover {
    transform: scale(1.08);
}

.player-time-indicator {
    color: #dcd0c4;
    font-family: var(--font-serif);
    font-size: 17px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-weight: 400;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    flex-shrink: 0;
    text-align: center;
    display: inline-block;
}

.player-scrubber-track {
    flex: 1;
    height: 5px;
    background: #332b25;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.player-scrubber-progress {
    height: 100%;
    background: linear-gradient(90deg, #c75a2d, #f09b77);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.player-scrubber-handle {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fed8c7;
    border: 2px solid #c75a2d;
    position: absolute;
    right: -6.5px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 6px rgba(240, 155, 119, 0.6);
}

.player-volume-icon,
.player-volume-btn {
    background: none;
    border: none;
    padding: 0;
    color: #d89e78;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: transform 0.15s ease, color 0.15s ease;
}

.player-volume-btn:hover {
    transform: scale(1.12);
    color: #f0b08e;
}

.player-volume-btn.muted {
    color: #8c604b;
    opacity: 0.75;
}

.player-volume-icon svg,
.player-volume-btn svg {
    fill: currentColor;
}

.preview-actions-row {
    width: 100%;
    max-width: 540px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .preview-actions-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .preview-actions-row .btn-re-record,
    .preview-actions-row .btn-confirm-upload {
        width: 100%;
    }
}

.btn-re-record {
    min-width: 145px;
}

.btn-confirm-upload {
    min-width: 190px;
}

/* ==========================================================================
   Screen 5 & QR Presentation
   ========================================================================== */
.qr-card-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.qr-card-subtitle {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 400;
    color: #5a4b42;
    margin-bottom: 18px;
    line-height: 1.4;
    max-width: 440px;
}

.qr-card-wrapper {
    background: #ffffff;
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(70, 35, 15, 0.1);
    border: 1.2px solid #ebd3c2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 20px 0;
}

.qr-image {
    width: 195px;
    height: 195px;
    display: block;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .qr-card-wrapper {
        padding: 12px;
        border-radius: 16px;
        margin: 4px 0 20px 0;
    }
    .qr-image {
        width: 145px;
        height: 145px;
    }
}

.qr-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-action-small {
    background: #fdf5ed;
    border: 1.5px solid var(--btn-gold-border);
    color: #883311;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-action-small:hover {
    background: #fae4d2;
}

/* Screen 5 Buttons & Actions (Desktop) */
.screen5-actions-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
}

#screen5-download-qr-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 240px;
    margin: 0;
    display: flex;
    justify-content: center;
}

#screen5-download-qr-wrapper[style*="display: none"] {
    display: none !important;
}

#btn-download-qr,
.btn-download-qr {
    width: 100%;
    max-width: 240px;
    font-size: 17px;
    padding: 10px 18px;
    min-height: 46px;
    border-radius: 14px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    margin: 0;
}

#btn-record-another,
.btn-record-another {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 240px;
    font-size: 17px;
    padding: 10px 18px;
    min-height: 46px;
    border-radius: 14px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    margin: 0;
}

/* ==========================================================================
   Alerts, Modals, Loading States
   ========================================================================== */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(254, 248, 240, 0.95);
    border-radius: var(--radius-card);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 24px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #ebd2c0;
    border-top-color: #c75b28;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 18px;
}

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

/* =========================================================================
   GLOBAL TOAST & INFORMATION NOTIFICATIONS (BOTTOM DOCKED)
   ========================================================================= */
.toast-notification {
    position: fixed;
    bottom: 24px;
    bottom: max(24px, env(safe-area-inset-bottom, 24px));
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    width: auto;
    min-width: 320px;
    max-width: 540px;
    background: rgba(36, 26, 20, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #ffffff;
    padding: 13px 18px;
    border-radius: 16px;
    border: 1.5px solid rgba(223, 156, 75, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.toast-body {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.toast-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.toast-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13.5px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.92);
    word-break: break-word;
}

.toast-close-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.toast-close-btn:hover {
    color: #ffffff;
}

/* Severity Theme Variants */
.toast-notification.error {
    background: rgba(46, 15, 13, 0.96);
    border-color: rgba(239, 68, 68, 0.6);
}
.toast-notification.error .toast-icon-wrap {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
.toast-notification.error .toast-title {
    color: #fca5a5;
}

.toast-notification.warning {
    background: rgba(48, 30, 10, 0.96);
    border-color: rgba(245, 158, 11, 0.6);
}
.toast-notification.warning .toast-icon-wrap {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}
.toast-notification.warning .toast-title {
    color: #fcd34d;
}

.toast-notification.success {
    background: rgba(14, 40, 24, 0.96);
    border-color: rgba(52, 211, 153, 0.6);
}
.toast-notification.success .toast-icon-wrap {
    background: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}
.toast-notification.success .toast-title {
    color: #6ee7b7;
}

.toast-notification.info {
    background: rgba(36, 26, 20, 0.96);
    border-color: rgba(223, 156, 75, 0.6);
}
.toast-notification.info .toast-icon-wrap {
    background: rgba(223, 156, 75, 0.2);
    color: #fcd34d;
}
.toast-notification.info .toast-title {
    color: #df9c4b;
}

/* Full Width On Mobile Devices (Docked to Bottom) */
@media (max-width: 600px) {
    .toast-notification {
        bottom: 14px;
        bottom: max(14px, env(safe-area-inset-bottom, 14px));
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
        min-width: 0;
        max-width: none;
        transform: translateY(140px);
        padding: 12px 14px;
        border-radius: 14px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    }
    .toast-notification.show {
        transform: translateY(0);
    }
    .toast-title {
        font-size: 14px;
    }
    .toast-text {
        font-size: 12.5px;
    }
}



/* Listen / Playback Page specific (Screen 6 Comfortably Scaled) */
.page-listen .content-card {
    max-width: 480px;
    padding: 22px 26px 20px 26px;
}

.page-listen .top-emblem {
    width: 120px;
    margin-bottom: 10px;
}

@media (min-width: 1200px) {
    .page-listen .top-emblem {
        width: 135px;
    }
}

.page-listen .story-title-badge-wrap {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    z-index: 40;
}

.story-meta-badge {
    background: rgba(194, 89, 45, 0.12);
    border: 1px solid rgba(223, 156, 75, 0.45);
    color: #883311;
    font-family: var(--font-serif);
    font-size: 14.5px;
    font-weight: 600;
    padding: 4px 15px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 90vw;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.story-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.btn-eye-popover {
    background: rgba(199, 91, 40, 0.14);
    border: 1px solid rgba(223, 156, 75, 0.65);
    color: #923712;
    width: 23px;
    height: 23px;
    min-width: 23px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 5px rgba(135, 48, 14, 0.15);
    flex-shrink: 0;
}

.btn-eye-popover:hover {
    background: #c75b28;
    color: #ffffff;
    transform: scale(1.12);
    box-shadow: 0 3px 8px rgba(135, 48, 14, 0.35);
    border-color: #f0b04a;
}

.btn-eye-popover:active {
    transform: scale(0.92);
}

.eye-icon-svg {
    width: 12px;
    height: 12px;
    display: block;
}

/* Story Title Popover Card */
.story-title-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.96);
    width: 270px;
    max-width: 86vw;
    background: rgba(255, 248, 240, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid #e09c53;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(80, 40, 15, 0.24), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 12px 14px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
    box-sizing: border-box;
    text-align: right;
}

body.lang-en .story-title-popover {
    text-align: left;
}

.story-title-popover.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

.story-title-popover .popover-arrow {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #e09c53 transparent;
}

.story-title-popover .popover-arrow::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #fff8f0 transparent;
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(199, 91, 40, 0.3);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.popover-title-label {
    font-family: var(--font-serif);
    font-size: 12.5px;
    font-weight: 700;
    color: #923712;
    letter-spacing: 0.3px;
}

.popover-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #7a5e4d;
    cursor: pointer;
    padding: 1px 5px;
    border-radius: 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.popover-close-btn:hover {
    color: #923712;
    transform: scale(1.15);
}

.popover-body {
    max-height: 140px;
    overflow-y: auto;
}

.popover-full-title {
    font-family: var(--font-serif);
    font-size: 13.5px;
    line-height: 1.45;
    color: #2a1f18;
    word-break: break-word;
    font-weight: 500;
}

.page-listen .story-author-name {
    font-family: var(--font-serif);
    font-size: 25px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 3px;
    line-height: 1.2;
}

.page-listen .story-recorded-time {
    font-family: var(--font-serif);
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.2;
}

.page-listen .btn-listen-main-play,
.page-listen #btn-main-play {
    width: 100%;
    max-width: 380px;
    font-size: 16px;
    padding: 8px 22px;
    min-height: 40px;
    border-radius: 13px;
    margin-bottom: 0;
}

.page-listen .custom-audio-player {
    width: 100%;
    max-width: 380px;
    padding: 8px 16px;
    margin: 9px 0 10px 0;
    gap: 12px;
    border-radius: 22px;
}

.page-listen .player-btn-circle {
    width: 34px;
    height: 34px;
    min-width: 34px;
}

.page-listen .player-btn-circle svg {
    width: 14px;
    height: 14px;
}

.page-listen .player-time-indicator {
    font-size: 13px;
    width: 34px;
    min-width: 34px;
}

.page-listen .player-scrubber-track {
    height: 6px;
}

.page-listen .player-volume-btn svg {
    width: 18px;
    height: 18px;
}

.page-listen .ios-silent-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    margin: 2px auto 8px auto;
    padding: 7px 12px;
    background: rgba(234, 112, 82, 0.1);
    border: 1px dashed rgba(234, 112, 82, 0.4);
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--color-ink, #2C3E50);
    text-align: center;
}

.page-listen .ios-hint-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.page-listen .listen-actions-container {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    align-items: center;
}

.page-listen .btn-listen-action,
.page-listen #btn-download-voice,
.page-listen #btn-record-new {
    width: 100%;
    font-size: 15px;
    padding: 8px 20px;
    min-height: 40px;
    border-radius: 13px;
}

/* ==========================================================================
   MOBILE RESPONSIVE SCREEN & CLIENT BACKGROUND MANAGEMENT
   (Strictly contained inside the central bordered box of client artwork)
   ========================================================================== */
@media (max-width: 768px) {
    /* Base Mobile Body Setup */
    body {
        background-color: #faebda;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        margin: 0;
        position: relative;
        overflow: hidden;
        display: block;
    }

    /* Screen 1 Mobile Background Layer (Pre-rendered in DOM, no top-center emblem since Screen 1 has the hero logo) */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background-image: url('../branding/mobile_screen_1.png');
        background-size: 100% 100%;
        background-position: center top;
        background-repeat: no-repeat;
        z-index: 1;
        opacity: 1;
        pointer-events: none;
    }

    /* Screen 2-5 & Listen Mobile Background Layer (Pre-rendered in DOM, with Illustrated Top Center Logo) */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background-image: url('../branding/mobile_screen_2_5.png');
        background-size: 100% 100%;
        background-position: center top;
        background-repeat: no-repeat;
        z-index: 2;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* Instantly / smoothly activate mobile_screen_2_5.png with top center logo on Screen 2, 3, 4, 5 and Screen 6 (Listen) */
    body[data-screen="2"]::after,
    body[data-screen="3"]::after,
    body[data-screen="4"]::after,
    body[data-screen="5"]::after,
    body[data-screen="listen"]::after,
    body.screen-2-active::after,
    body.screen-3-active::after,
    body.screen-4-active::after,
    body.screen-5-active::after,
    body.page-listen::after {
        opacity: 1;
    }

    /* Top emblem is already illustrated in the mobile background header for Screens 2-5 & Listen */
    .top-emblem-container {
        display: none !important;
    }

    /* Mobile App Viewport: Fixed inside the client background central frame */
    .app-viewport {
        position: absolute;
        top: 23.8%;
        left: 15.2%;
        width: 69.6%;
        height: 52.4%;
        max-width: 69.6%;
        max-height: 52.4%;
        min-height: 0;
        margin: 0;
        padding: 10px 8px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        z-index: 10;
    }

    .app-viewport::-webkit-scrollbar {
        display: none;
    }

    /* Screen Base */
    .app-screen {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .app-screen.active {
        display: flex;
    }

    /* Screen 1: Landing Content */
    .screen-landing {
        width: 100%;
        height: 100%;
        display: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .screen-landing.active {
        display: flex;
    }

    .screen-landing .hero-emblem {
        width: 180px;
        max-width: 82%;
        height: auto;
        margin-top: 0;
        margin-bottom: 20px;
        filter: drop-shadow(0 6px 14px rgba(60, 30, 10, 0.2));
    }

    .screen-landing .btn-terracotta {
        width: 100%;
        max-width: 220px;
        font-size: 16px;
        padding: 9px 16px;
        min-height: 40px;
        border-radius: 12px;
    }

    /* Seamless Card Container inside the illustrated frame */
    .content-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        width: 100%;
        max-width: 100%;
        padding: 0 !important;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* =========================================================================
       SCREEN 2: Form inputs & Gold Mic
       ========================================================================= */
    .form-group-container {
        width: 100%;
        gap: 12px;
        margin-bottom: 16px;
    }

    .pill-input-wrapper {
        width: 100%;
    }

    .pill-input {
        width: 100%;
        height: 46px;
        font-size: 16.5px;
        padding: 0 16px;
        border-radius: 12px;
        border-width: 1.6px;
    }

    .pill-input::placeholder {
        font-size: 15.5px;
    }

    .input-helper-text {
        font-size: 15px;
        margin-bottom: 14px;
        line-height: 1.35;
        font-weight: 500;
        color: #2e2119;
    }

    .mic-btn-container {
        margin: 6px 0;
    }

    .btn-gold-mic {
        width: 96px;
        height: 96px;
    }

    .mic-icon-svg {
        width: 48px;
        height: 48px;
    }

    .length-notice {
        font-size: 13.5px;
        margin-top: 14px;
        font-weight: 500;
        color: #6e584c;
    }

    /* =========================================================================
       SCREEN 3: Voice Recording
       ========================================================================= */
    .recording-badge {
        font-size: 12.5px;
        padding: 5px 18px;
        margin-bottom: 14px;
        letter-spacing: 1px;
        font-weight: 500;
    }

    .timer-display {
        font-size: 52px;
        margin-bottom: 14px;
        letter-spacing: 1.5px;
    }

    .visualizer-capsule {
        height: 54px;
        width: 100%;
        max-width: 100%;
        padding: 6px 14px;
        margin-bottom: 14px;
        border-radius: 28px;
    }

    .recording-status-text {
        font-size: 15.5px;
        margin-bottom: 22px;
        font-weight: 500;
        color: #3f603f;
    }

    .actions-row {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 12px;
        justify-content: center;
        align-items: center;
    }

    .actions-row .btn-terracotta,
    .actions-row .btn-outline-terracotta {
        flex: 1;
        width: auto;
        min-width: 0;
        font-size: 16.5px;
        padding: 9px 14px;
        min-height: 44px;
        border-radius: 12px;
        white-space: nowrap;
    }

    /* =========================================================================
       SCREEN 4: Preview Playback
       ========================================================================= */
    .preview-header-layout {
        width: 100%;
        max-width: 100%;
        margin-bottom: 8px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .preview-left-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .preview-title-text {
        font-size: 16.5px;
        font-weight: 500;
    }

    .btn-play-preview-pill {
        font-size: 14.5px;
        padding: 5px 16px;
        min-height: 34px;
        border-radius: 10px;
        align-self: flex-start;
    }

    /* Dedicated separate row for timer on mobile */
    .preview-header-layout .card-header-meta {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        font-size: 15.5px;
        font-weight: 500;
        margin: 4px 0 0 0;
        padding-right: 4px;
    }

    .custom-audio-player {
        width: 100%;
        max-width: 100%;
        margin: 10px 0 18px 0;
        padding: 9px 14px;
        gap: 12px;
        border-radius: 26px;
    }

    .player-btn-circle {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .player-btn-circle svg {
        width: 16px;
        height: 16px;
    }

    .player-time-indicator {
        font-size: 15px;
        width: 38px;
        min-width: 38px;
    }

    .player-volume-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Actions row on mobile */
    .preview-actions-row {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .preview-actions-row .btn-terracotta,
    .preview-actions-row .btn-outline-terracotta {
        width: 100%;
        min-width: 0;
        font-size: 16.5px;
        padding: 9px 16px;
        min-height: 44px;
        border-radius: 12px;
    }

    /* =========================================================================
       SCREEN 5: QR Code Ready
       ========================================================================= */
    .qr-card-title {
        font-size: 19px;
        font-weight: 600;
        margin-bottom: 3px;
        line-height: 1.25;
    }

    .qr-card-subtitle {
        font-size: 11.5px;
        margin-bottom: 6px;
        line-height: 1.2;
        max-width: 240px;
        color: #4e3f36;
    }

    .qr-card-wrapper {
        padding: 6px;
        border-radius: 12px;
        margin: 2px 0 6px 0;
        box-shadow: 0 3px 12px rgba(70, 35, 15, 0.1);
    }

    .qr-image {
        width: 122px;
        height: 122px;
    }

    /* Screen 5 buttons on mobile (Individual row per button) */
    .screen5-actions-container {
        width: 100%;
        max-width: 250px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin: 4px auto 0 auto;
    }

    #screen5-download-qr-wrapper {
        width: 100%;
        max-width: 250px;
        margin: 0;
        display: flex;
        justify-content: center;
    }

    #screen5-download-qr-wrapper[style*="display: none"] {
        display: none !important;
    }

    #btn-download-qr,
    .btn-download-qr {
        width: 100%;
        max-width: 250px;
        font-size: 13px;
        padding: 6px 14px;
        min-height: 36px;
        border-radius: 11px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin: 0;
    }

    #btn-download-qr svg,
    .btn-download-qr svg {
        width: 15px;
        height: 15px;
    }

    #btn-record-another,
    .btn-record-another {
        width: 100%;
        max-width: 250px;
        font-size: 13px;
        padding: 6px 14px;
        min-height: 36px;
        border-radius: 11px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin: 0;
    }

    /* =========================================================================
       PLAYBACK / LISTEN PAGE (Screen 6 Mobile Comfortably Scaled)
       ========================================================================= */
    .page-listen .story-title-badge-wrap {
        margin-bottom: 4px;
    }

    .page-listen .story-meta-badge {
        font-size: 13px;
        padding: 3px 12px;
        gap: 5px;
        line-height: 1.25;
    }

    .page-listen .btn-eye-popover {
        width: 21px;
        height: 21px;
        min-width: 21px;
    }

    .page-listen .btn-eye-popover .eye-icon-svg {
        width: 11px;
        height: 11px;
    }

    .page-listen .story-title-popover {
        width: 240px;
        max-width: 82vw;
        padding: 9px 11px;
    }

    .page-listen .story-author-name {
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .page-listen .story-recorded-time {
        font-size: 12px;
        margin-bottom: 6px;
        line-height: 1.2;
    }

    .page-listen .listen-actions-container {
        margin-top: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
        max-width: 245px;
        margin-left: auto;
        margin-right: auto;
    }

    .page-listen #btn-main-play,
    .page-listen #btn-download-voice,
    .page-listen #btn-record-new,
    .page-listen .btn-listen-action,
    .page-listen a.btn-outline-terracotta,
    .page-listen a.btn-terracotta,
    .page-listen button.btn-terracotta {
        width: 100%;
        max-width: 245px;
        font-size: 14.5px;
        padding: 7px 16px;
        min-height: 38px;
        border-radius: 12px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    .page-listen #btn-main-play {
        margin-bottom: 5px !important;
    }

    .page-listen .custom-audio-player {
        width: 100%;
        max-width: 245px;
        margin: 0 auto 6px auto;
        padding: 5px 12px;
        border-radius: 20px;
        gap: 8px;
    }

    .page-listen .player-btn-circle {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .page-listen .player-btn-circle svg {
        width: 14px;
        height: 14px;
    }

    .page-listen .player-time-indicator {
        font-size: 12.5px;
        width: 32px;
        min-width: 32px;
    }

    .page-listen .player-scrubber-track {
        height: 5px;
    }

    .page-listen .player-volume-btn svg {
        width: 17px;
        height: 17px;
    }

    .page-listen .ios-silent-hint {
        max-width: 245px;
        font-size: 10.5px;
        padding: 4px 8px;
        margin: 2px auto 6px auto;
        border-radius: 10px;
        gap: 5px;
    }

    .page-listen .ios-hint-icon {
        font-size: 12px;
    }

    .loading-overlay {
        background: rgba(250, 235, 218, 0.96);
        border-radius: 14px;
        padding: 14px;
    }
}

