.maqasid-hero{
    padding:20px 22px;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(480px,760px);
    gap:16px;
    align-items:center;
    margin-bottom:16px;
    background:linear-gradient(135deg,rgba(255,250,240,.96),rgba(255,240,205,.9));
}

.maqasid-kicker{
    display:inline-flex;
    background:#fff;
    border:1px solid rgba(185,138,47,.32);
    color:#8e5d22;
    border-radius:999px;
    padding:7px 12px;
    font-weight:900;
    margin-bottom:8px;
}

.maqasid-hero h2{
    margin:0;
    color:#5b3a18;
    font-size:34px;
    font-weight:900;
}

.maqasid-hero p{
    margin:8px 0 0;
    color:#746956;
    line-height:1.8;
    font-weight:700;
}

.maqasid-form{
    display:grid;
    grid-template-columns:1fr 180px auto;
    gap:9px;
    align-items:end;
}

.maqasid-form label{
    display:grid;
    gap:5px;
    background:#fff;
    border:1px solid rgba(91,58,24,.18);
    border-radius:16px;
    padding:10px 12px;
}

.maqasid-form label span{
    color:#746956;
    font-size:12px;
    font-weight:900;
}

.maqasid-form select{
    border:0;
    outline:0;
    background:transparent;
    color:#5b3a18;
    font-size:16px;
    font-weight:900;
    font-family:Tajawal,Arial,sans-serif;
}

.maqasid-form button{
    border:0;
    border-radius:16px;
    padding:18px 20px;
    background:linear-gradient(135deg,#8e5d22,#c99a3e);
    color:#fff;
    font-weight:900;
    font-family:Tajawal,Arial,sans-serif;
    cursor:pointer;
}

.maqasid-options{
    grid-column:1/-1;
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.maqasid-options label{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:999px;
    padding:8px 12px;
    cursor:pointer;
}

.maqasid-options input{
    width:18px;
    height:18px;
    accent-color:#b3342c;
}

.maqasid-layout{
    display:grid;
    grid-template-columns:420px minmax(0,1fr) 300px;
    gap:16px;
    align-items:start;
}

.maqasid-mushaf-panel,
.maqasid-side-panel{
    position:sticky;
    top:124px;
}

.maqasid-mushaf-frame{
    background:#f3e5c5;
    padding:14px;
    min-height:620px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.maqasid-mushaf-img{
    display:block;
    width:100%;
    max-height:760px;
    object-fit:contain;
    border-radius:13px;
    background:#fff;
    border:1px solid rgba(91,58,24,.14);
    box-shadow:0 18px 38px rgba(0,0,0,.16);
}

.maqasid-tools{
    display:flex;
    gap:8px;
    padding:12px 14px 16px;
    border-top:1px solid rgba(91,58,24,.12);
}

.maqasid-tools a{
    flex:1;
    text-align:center;
    background:#fff;
    border:1px solid rgba(91,58,24,.18);
    border-radius:14px;
    padding:10px;
    font-weight:900;
    color:#5b3a18;
}

.maqasid-info-bar{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    padding:14px;
}

.maqasid-info-bar div{
    background:#fff;
    border:1px solid rgba(91,58,24,.16);
    border-radius:18px;
    padding:14px;
    text-align:center;
}

.maqasid-info-bar b{
    display:block;
    color:#b3342c;
    font-size:24px;
    font-weight:900;
}

.maqasid-info-bar span{
    color:#746956;
    font-size:12px;
    font-weight:900;
}

.maqasid-list{
    display:grid;
    gap:12px;
    padding:0 14px 16px;
    max-height:860px;
    overflow:auto;
}

.maqasid-card{
    background:#fffdf7;
    border:1px solid rgba(91,58,24,.16);
    border-radius:18px;
    padding:15px;
    cursor:pointer;
    transition:.2s;
}

.maqasid-card:hover,
.maqasid-card.active{
    border-color:rgba(179,52,44,.48);
    background:linear-gradient(135deg,#fffdf7,#fff5df);
    box-shadow:0 16px 32px rgba(179,52,44,.10);
}

.maqasid-card-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:10px;
}

.maqasid-card-head strong{
    display:block;
    color:#5b3a18;
    font-size:22px;
    font-weight:900;
}

.maqasid-card-head span{
    display:block;
    color:#746956;
    font-size:13px;
    font-weight:900;
    margin-top:4px;
}

.maqasid-card-head em{
    font-style:normal;
    min-width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#fff8e8;
    border:1px solid rgba(91,58,24,.16);
    color:#b3342c;
    font-weight:900;
}

.maqasid-summary{
    color:#1f1a12;
    font-size:17px;
    font-weight:900;
    line-height:1.8;
    margin-bottom:8px;
}

.maqasid-description{
    color:#1f1a12;
    font-size:18px;
    line-height:2;
    background:#fff;
    border:1px solid rgba(91,58,24,.10);
    border-radius:16px;
    padding:12px 14px;
    white-space:normal;
}

.maqasid-code-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.maqasid-code-row span{
    background:#fff8e8;
    border:1px solid rgba(91,58,24,.14);
    color:#5b3a18;
    border-radius:999px;
    padding:6px 10px;
    font-weight:900;
    font-size:13px;
}

.maqasid-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:12px;
}

.maqasid-actions a{
    border:1px solid rgba(91,58,24,.18);
    background:#fff8e8;
    color:#5b3a18;
    border-radius:13px;
    padding:9px 12px;
    font-weight:900;
    font-size:13px;
}

.maqasid-surah-list{
    display:grid;
    gap:7px;
    padding:12px;
    max-height:760px;
    overflow:auto;
}

.maqasid-surah-list a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    background:#fff;
    border:1px solid rgba(91,58,24,.16);
    border-radius:14px;
    padding:10px 12px;
    color:#5b3a18;
    font-weight:900;
}

.maqasid-surah-list a.active{
    border-color:rgba(179,52,44,.5);
    background:#fff5df;
}

.maqasid-surah-list b{
    background:#fff8e8;
    border:1px solid rgba(91,58,24,.12);
    border-radius:999px;
    padding:4px 9px;
}

@media(max-width:1350px){
    .maqasid-layout{
        grid-template-columns:380px minmax(0,1fr);
    }

    .maqasid-side-panel{
        grid-column:1/-1;
        position:relative;
        top:auto;
    }

    .maqasid-surah-list{
        grid-template-columns:repeat(3,1fr);
        max-height:none;
    }
}

@media(max-width:900px){
    .maqasid-hero,
    .maqasid-layout{
        grid-template-columns:1fr;
    }

    .maqasid-form{
        grid-template-columns:1fr;
    }

    .maqasid-mushaf-panel{
        position:relative;
        top:auto;
    }

    .maqasid-mushaf-frame{
        min-height:auto;
    }

    .maqasid-mushaf-img{
        max-width:420px;
    }

    .maqasid-info-bar{
        grid-template-columns:1fr;
    }

    .maqasid-surah-list{
        grid-template-columns:1fr;
    }

    .maqasid-list{
        max-height:none;
    }
}

@media(max-width:520px){
    .maqasid-hero{
        padding:14px;
    }

    .maqasid-hero h2{
        font-size:27px;
    }

    .maqasid-card-head{
        display:grid;
    }

    .maqasid-description{
        font-size:16px;
        line-height:1.9;
    }

    .maqasid-actions a{
        width:100%;
        text-align:center;
    }
}


.maqasid-info-btn{
    border:1px solid rgba(91,58,24,.18);
    border-radius:16px;
    padding:18px 20px;
    background:#fff;
    color:#5b3a18;
    font-weight:900;
    font-family:Tajawal,Arial,sans-serif;
    cursor:pointer;
}

.maqasid-values-panel{
    margin:0 14px 14px;
    background:#fffdf7;
    border:1px solid rgba(91,58,24,.16);
    border-radius:18px;
    overflow:hidden;
}

.maqasid-values-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:13px 15px;
    background:linear-gradient(135deg,#fff8e8,#fff);
    border-bottom:1px solid rgba(91,58,24,.12);
}

.maqasid-values-head h3{
    margin:0;
    color:#5b3a18;
    font-size:18px;
    font-weight:900;
}

.maqasid-values-head span{
    color:#b3342c;
    font-weight:900;
    font-size:13px;
}

.maqasid-values-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    padding:12px;
    max-height:360px;
    overflow:auto;
}

.maqasid-value-card{
    display:grid;
    grid-template-columns:auto auto minmax(0,1fr);
    gap:8px;
    align-items:start;
    background:#fff;
    border:1px solid rgba(91,58,24,.12);
    border-radius:15px;
    padding:10px;
}

.maqasid-value-card b{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#fff8e8;
    color:#b3342c;
    font-size:22px;
    font-weight:900;
    font-family:Amiri,serif;
}

.maqasid-value-card em{
    font-style:normal;
    width:26px;
    height:26px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#f4ead5;
    color:#5b3a18;
    font-size:12px;
    font-weight:900;
}

.maqasid-value-card span{
    color:#1f1a12;
    line-height:1.7;
    font-weight:800;
}

.maqasid-modal{
    position:fixed;
    inset:0;
    z-index:9999;
    direction:rtl;
}

.maqasid-modal[hidden]{
    display:none;
}

.maqasid-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.55);
    backdrop-filter:blur(4px);
}

.maqasid-modal-card{
    position:relative;
    width:min(980px,calc(100vw - 28px));
    max-height:calc(100vh - 34px);
    overflow:auto;
    margin:17px auto;
    background:linear-gradient(135deg,#fffaf0,#fff2d5);
    border:1px solid rgba(91,58,24,.24);
    border-radius:26px;
    box-shadow:0 28px 80px rgba(0,0,0,.35);
}

.maqasid-modal-close{
    position:absolute;
    top:12px;
    left:12px;
    border:0;
    background:#111;
    color:#fff;
    width:38px;
    height:38px;
    border-radius:50%;
    font-size:28px;
    line-height:1;
    cursor:pointer;
    z-index:2;
}

.maqasid-modal-body{
    padding:24px;
}

.maqasid-modal-head span{
    display:inline-flex;
    background:#fff;
    border:1px solid rgba(185,138,47,.32);
    color:#8e5d22;
    border-radius:999px;
    padding:6px 12px;
    font-weight:900;
    margin-bottom:8px;
}

.maqasid-modal-head h2{
    margin:0 0 14px;
    color:#5b3a18;
    font-size:30px;
    font-weight:900;
}

.maqasid-info-content{
    background:#fff;
    border:1px solid rgba(91,58,24,.14);
    border-radius:18px;
    padding:18px;
    color:#1f1a12;
    font-size:17px;
    line-height:2;
    font-weight:700;
    white-space:normal;
}

@media(max-width:900px){
    .maqasid-values-grid{
        grid-template-columns:1fr;
    }

    .maqasid-info-btn{
        width:100%;
    }
}