.qm-page {
    --emerald-900: #0f3d2e;
    --emerald-700: #16563f;
    --emerald-600: #1f7a5c;
    --emerald-500: #2e9470;
    --gold: #c9a227;
    --gold-soft: #e9d99a;
    --cream: #faf7f0;
    --paper: #f3efe4;
    --ink: #16241d;
    --muted: #6b7a72;
    --line: #e7e2d3;
    --card: #ffffff;
}

.qm-page {
    font-family: 'Outfit', sans-serif;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

/* ===== Header band with Islamic geometric motif ===== */
.qm-page .qm-hero {
    position: relative;
    background: linear-gradient(155deg, var(--emerald-900), var(--emerald-700) 70%);
    padding: 46px 24px;
    overflow: hidden;
}
.qm-page .qm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.16;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1'%3E%3Cpath d='M42 4 L64 21 L64 63 L42 80 L20 63 L20 21 Z'/%3E%3Cpath d='M42 4 L20 21 L42 38 L64 21 Z'/%3E%3Cpath d='M42 80 L20 63 L42 46 L64 63 Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 84px 84px;
}
.qm-page .qm-hero-inner {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.qm-page .qm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-soft);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.qm-page .qm-eyebrow i { font-size: 0.7rem; }
.qm-page .qm-hero h1 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}
.qm-page .qm-hero p {
    color: rgba(255,255,255,0.72);
    margin: 8px 0 0;
    font-size: 0.95rem;
    max-width: 480px;
}
.qm-page .qm-count-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(233,217,154,0.35);
    color: var(--gold-soft);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

/* ===== Layout ===== */
.qm-page .qm-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 50px;
}

.qm-page .audio-card {
    background: var(--card);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 14px 34px rgba(15,61,46,0.08);
    margin-bottom: 22px;
    border: 1px solid var(--line);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.qm-page .audio-card:hover {
    box-shadow: 0 22px 46px rgba(15,61,46,0.14);
    transform: translateY(-3px);
}

/* Cover — never stretched, never cropped, adapts to portrait/landscape */
.qm-page .audio-cover {
    flex: 0 0 168px;
    width: 168px;
    height: 168px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(150deg, var(--emerald-900), var(--emerald-600));
    box-shadow: 0 10px 24px rgba(15,61,46,0.22);
}
.qm-page .audio-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    filter: blur(16px) saturate(1.1);
    transform: scale(1.2);
    z-index: 1;
}
.qm-page .audio-cover img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.qm-page .audio-body {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.qm-page .audio-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.qm-page .badge {
    display: inline-block;
    background: var(--paper);
    color: var(--emerald-700);
    border: 1px solid var(--line);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qm-page .audio-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.28rem;
    margin: 9px 0 3px;
    color: var(--ink);
    line-height: 1.25;
}

.qm-page .scholar {
    color: var(--muted);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.qm-page .scholar i { color: var(--gold); }

.qm-page .audio-meta {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 0.8rem;
    flex-wrap: wrap;
    white-space: nowrap;
}
.qm-page .audio-meta i { color: var(--emerald-500); margin-right: 4px; }

.qm-page .description {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.93rem;
}

/* Player */
.qm-page .player-box {
    background: var(--paper);
    padding: 10px 14px;
    border-radius: 14px;
    margin-top: 14px;
    border: 1px solid var(--line);
}
.qm-page .player-box audio {
    width: 100%;
    height: 38px;
    accent-color: var(--emerald-600);
    border-radius: 10px;
    display: block;
}

/* Actions */
.qm-page .actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.qm-page .btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.25s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
}
.qm-page .btn-download {
    background: var(--emerald-600);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31,122,92,0.28);
}
.qm-page .btn-download:hover { background: var(--emerald-700); transform: translateY(-1px); }
.qm-page .btn-share {
    background: var(--paper);
    color: var(--emerald-700);
    border: 1px solid var(--line);
    flex: 0 0 50px;
}
.qm-page .btn-share:hover { background: #ece6d4; }

/* Toast */
.qm-page .qm-toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--emerald-900);
    color: #fff;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999;
}
.qm-page .qm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Empty State */
.qm-page .empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
    background: var(--card);
    border-radius: 22px;
    border: 1px solid var(--line);
}
.qm-page .empty i { margin-bottom: 14px; color: var(--emerald-500); }

/* Responsive */
@media (max-width: 640px) {
    .qm-page .qm-hero { padding: 36px 18px 56px; }
    .qm-page .qm-container { padding: 0 14px; }
    .qm-page .audio-card { padding: 16px; border-radius: 18px; gap: 14px; }
    .qm-page .audio-cover { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 16/9; }
    .qm-page .audio-title { font-size: 1.1rem; }
    .qm-page .btn-download { font-size: 0.85rem; padding: 11px; }
    .qm-page .btn-share { flex: 0 0 46px; padding: 11px; }
}