.qke-drawer-open {
    overflow: hidden;
}

.qke-entity-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
}

.qke-entity-overlay[hidden] {
    display: none;
}

.qke-entity-drawer {
    width: min(760px, 96vw);
    height: 100%;
    overflow: hidden;
    border-right: 1px solid rgba(230, 201, 121, 0.24);
    background:
        radial-gradient(circle at 50% 0%, rgba(38, 111, 82, 0.28), transparent 34%),
        linear-gradient(160deg, #04120e, #08251c);
    box-shadow: 30px 0 90px rgba(0, 0, 0, 0.52);
    animation: qkeSlideIn 220ms ease-out;
}

.qke-drawer-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(4, 18, 14, 0.72);
    backdrop-filter: blur(14px);
}

.qke-close,
.qke-history-back {
    border: 1px solid rgba(230, 201, 121, 0.22);
    border-radius: 999px;
    color: #f8f4e8;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
}

.qke-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
}

.qke-history-back {
    padding: 8px 16px;
}

.qke-drawer-body {
    height: calc(100% - 64px);
    overflow-y: auto;
    padding: 26px;
    color: #f8f4e8;
    font-family: "Cairo", sans-serif;
}

.qke-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 24px;
    color: #b7c9c1;
    font-size: 0.76rem;
}

.qke-breadcrumb-item {
    padding: 0;
    border: 0;
    color: #d9c27f;
    background: none;
    cursor: pointer;
}

.qke-entity-hero {
    display: flex;
    align-items: center;
    gap: 18px;
}

.qke-main-icon {
    --qke-color: #e6c979;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--qke-color), transparent 42%);
    border-radius: 22px;
    color: var(--qke-color);
    background: color-mix(in srgb, var(--qke-color), transparent 90%);
    font-size: 1.55rem;
}

.qke-kicker {
    margin: 0;
    color: #d9c27f;
    font-size: 0.76rem;
}

.qke-entity-hero h1 {
    margin: 4px 0 0;
    font-family: "Amiri", serif;
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1;
}

.qke-english-name {
    margin: 8px 0 0;
    color: #92aaa0;
    direction: ltr;
    text-align: right;
}

.qke-description {
    margin: 24px 0;
    color: #c3d1cb;
    line-height: 2;
}

.qke-tags,
.qke-aliases {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qke-tags span,
.qke-aliases span {
    padding: 7px 11px;
    border: 1px solid rgba(230, 201, 121, 0.18);
    border-radius: 999px;
    color: #dec98c;
    background: rgba(230, 201, 121, 0.07);
    font-size: 0.74rem;
}

.qke-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 24px 0 30px;
}

.qke-metrics div {
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.03);
}

.qke-metrics strong,
.qke-metrics span {
    display: block;
}

.qke-metrics strong {
    color: #efd995;
    font-size: 1.35rem;
}

.qke-metrics span {
    margin-top: 2px;
    color: #99aea5;
    font-size: 0.7rem;
}

.qke-section {
    margin-top: 28px;
}

.qke-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.qke-section-title h3 {
    margin: 0;
    font-family: "Amiri", serif;
    font-size: 1.55rem;
}

.qke-section-title span {
    min-width: 30px;
    padding: 4px 8px;
    text-align: center;
    border-radius: 999px;
    color: #dcc47e;
    background: rgba(230, 201, 121, 0.09);
    font-size: 0.72rem;
}

.qke-ayah-list,
.qke-related-grid {
    display: grid;
    gap: 11px;
}

.qke-ayah-card {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
}

.qke-ayah-card p {
    margin: 0;
    font-family: "Amiri", serif;
    font-size: 1.48rem;
    line-height: 2.15;
}

.qke-ayah-card footer {
    margin-top: 11px;
    color: #dfc77f;
    font-size: 0.76rem;
}

.qke-related-card {
    width: 100%;
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 18px;
    color: #f8f4e8;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: 160ms ease;
}

.qke-related-card:hover {
    transform: translateX(-4px);
    border-color: rgba(230, 201, 121, 0.35);
    background: rgba(230, 201, 121, 0.07);
}

.qke-related-icon {
    --qke-color: #e6c979;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--qke-color);
    background: color-mix(in srgb, var(--qke-color), transparent 90%);
}

.qke-related-copy small,
.qke-related-copy strong,
.qke-related-copy em {
    display: block;
}

.qke-related-copy small {
    color: #98ada4;
    font-size: 0.68rem;
}

.qke-related-copy strong {
    margin-top: 3px;
}

.qke-related-copy em {
    margin-top: 4px;
    overflow: hidden;
    color: #afc0b9;
    font-size: 0.7rem;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qke-strength {
    min-width: 36px;
    color: #dec77f;
    font-size: 0.76rem;
}

.qke-empty-section {
    padding: 18px;
    border: 1px dashed rgba(230, 201, 121, 0.19);
    border-radius: 18px;
    color: #9fb1aa;
}

.qke-state-card {
    min-height: 60vh;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    color: #b7c9c1;
}

.qke-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(230, 201, 121, 0.16);
    border-top-color: #e6c979;
    border-radius: 50%;
    animation: qkeSpin 0.85s linear infinite;
}

.qke-error {
    color: #ffd4d4;
}

@keyframes qkeSlideIn {
    from { transform: translateX(-24px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

@media (max-width: 620px) {
    .qke-entity-drawer {
        width: 100%;
    }

    .qke-drawer-body {
        padding: 19px;
    }

    .qke-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .qke-related-copy em {
        display: none;
    }
}
