@import url('https://fonts.googleapis.com/css2?family=Lateef:wght@400;500;600;700&display=swap');

:root{
    --g:#137a4c;
    --gd:#0b5738;
    --gl:#eaf7f0;
    --b:#d7e7de;
    --t:#21342b;
    --m:#66756d;
}

*{box-sizing:border-box}

body{
    margin:0;
    background:#f4f8f6;
    color:var(--t);
    font-family:Arial,sans-serif;
    line-height:1.65;
}

header{
    background:linear-gradient(135deg,var(--gd),var(--g));
    color:#fff;
    padding:28px 16px;
}

header h1{margin:.2rem 0 0}

.wrap{
    width:min(1000px,calc(100% - 24px));
    margin:auto;
}

.picker,.card,.example{
    background:#fff;
    border:1px solid var(--b);
    border-radius:15px;
    box-shadow:0 8px 22px rgba(0,0,0,.05);
}

.picker{
    margin:22px 0 16px;
    padding:14px;
    display:flex;
    gap:12px;
    align-items:center;
}

.picker label{
    font-weight:700;
    color:var(--gd);
}

select{
    flex:1;
    min-width:0;
    padding:10px;
    border:1px solid var(--b);
    border-radius:9px;
    background:var(--gl);
}

.card{
    padding:24px;
    margin-bottom:18px;
}

h2{
    color:var(--gd);
    display:flex;
    gap:10px;
    align-items:center;
}

h2 span,.sectiontitle span{
    display:inline-grid;
    place-items:center;
    width:33px;
    height:33px;
    border-radius:50%;
    background:var(--gl);
    font-size:16px;
    flex:0 0 auto;
}

.urdu,
.urdu-inline,
.alphabet-table td:nth-child(1),
.alphabet-table td:nth-child(3){
    font-family:'Lateef','Noto Nastaliq Urdu','Noto Naskh Arabic',serif;
}

.urdu{
    color:var(--gd);
    font-size:31px;
    line-height:1.8;
    text-align:center;
    padding:15px;
    background:var(--gl);
    border-radius:12px;
}

.urdu-inline{
    color:var(--gd);
    font-size:1.5em;
    line-height:1;
}

.big{font-size:40px}

.lesson-01 .lesson-one-display{font-size:58px}
.lesson-01 .lesson-one-letters{font-size:46px}

.lesson-01 .alphabet-table td:nth-child(1),
.lesson-01 .alphabet-table td:nth-child(3){
    font-size:35px;
    line-height:1.25;
}

.tablebox{overflow:auto}

table{
    width:100%;
    border-collapse:collapse;
}

th,td{
    padding:9px;
    border:1px solid var(--b);
    text-align:center;
}

th{
    background:var(--gd);
    color:#fff;
}

.pattern{
    text-align:center;
    background:var(--gl);
    border-radius:12px;
    padding:14px;
    margin:14px 0;
}

.sectiontitle{
    color:var(--gd);
    display:flex;
    gap:10px;
    align-items:center;
}

.grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.example{
    position:relative;
    padding:20px;
    text-align:center;
}

.number{
    position:absolute;
    top:8px;
    left:9px;
    background:var(--gl);
    border-radius:50%;
    width:27px;
    height:27px;
    display:grid;
    place-items:center;
    font-size:12px;
}

.media-slot{
    width:100%;
    height:88px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:0 auto 4px;
    overflow:hidden;
}

.emoji-symbol{
    font-size:50px;
    line-height:1;
    white-space:nowrap;
}

.lesson-picture{
    display:block;
    width:auto;
    height:auto;
    max-width:140px;
    max-height:78px;
    object-fit:contain;
}

.exurdu{
    background:none;
    padding:4px;
    font-size:32px;
}

.example p{
    margin:.2rem 0;
    color:var(--m);
}

.comparison{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
    margin:16px 0;
}

.comparison>div{
    border:1px solid var(--b);
    border-radius:12px;
    padding:14px;
    text-align:center;
    background:#fbfdfc;
}

.comparison small{
    display:block;
    color:var(--m);
    font-weight:700;
    margin-bottom:6px;
}

.note{
    border-left:4px solid var(--g);
    background:#f5fbf7;
    border-radius:8px;
    padding:13px 15px;
    margin-top:14px;
}

button,.nav a,.nav button{
    font:inherit;
    font-weight:700;
    border-radius:10px;
    cursor:pointer;
}

.primary,.nav a,.nav button{
    border:0;
    background:linear-gradient(135deg,var(--gd),var(--g));
    color:#fff;
    padding:12px 18px;
}

.secondary{
    border:1px solid var(--b);
    background:#fff;
    color:var(--gd);
    padding:12px 18px;
}

.progress{
    display:flex;
    justify-content:space-between;
    margin-top:20px;
    color:var(--m);
    font-weight:700;
}

.prompt,.center{text-align:center}

.question{
    text-align:center;
    font-size:25px;
    font-weight:700;
    color:var(--gd);
    margin:8px 0 16px;
}

.question.urduq{
    font-family:'Lateef','Noto Nastaliq Urdu',serif;
    font-size:38px;
    line-height:1.7;
}

.answers{
    display:grid;
    gap:9px;
}

.answer{
    padding:12px;
    border:1px solid var(--b);
    background:#fff;
    color:var(--t);
}

.answer.urdua{
    font-family:'Lateef','Noto Nastaliq Urdu',serif;
    font-size:27px;
    line-height:1.5;
}

.correct{
    background:#e6f8ed!important;
    border-color:#138a58!important;
}

.wrong{
    background:#fff0ef!important;
    border-color:#b42318!important;
}

.feedback{
    text-align:center;
    font-weight:700;
    min-height:28px;
}

.finalscore{
    text-align:center;
    font-size:22px;
    font-weight:700;
}

.review{
    border:1px solid #efc3bf;
    background:#fffafa;
    border-radius:10px;
    padding:12px;
    margin-top:10px;
}

.resultbuttons{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:18px;
}

.nav{
    display:grid;
    gap:12px;
    margin:22px 0;
}

.nav.one{grid-template-columns:1fr}
.nav.two{grid-template-columns:1fr 1fr}

.nav a,.nav button{
    text-align:center;
    text-decoration:none;
}

@media(max-width:650px){
    .picker{display:block}
    .picker label{display:block;margin-bottom:6px}
    .picker select{width:100%;font-size:12px}
    .grid{grid-template-columns:1fr}
    .card{padding:18px}
    .nav a,.nav button{font-size:13px;padding:12px 8px}
    .comparison{grid-template-columns:1fr}
    .lesson-01 .lesson-one-display{font-size:46px}
    .lesson-01 .lesson-one-letters{font-size:37px}
    .lesson-01 .alphabet-table td:nth-child(1),
    .lesson-01 .alphabet-table td:nth-child(3){font-size:28px}
    .lesson-picture{max-width:130px;max-height:74px}
}

/* LATEEF-TABLE-FIX-START */
/*
   Font and Lesson 1 repair:
   - Lateef is loaded in each lesson's <head>.
   - !important prevents an older cached/fallback font rule from winning.
   - Only Lesson 1's Urdu alphabet text is enlarged on desktop.
*/
[lang="ur"],
[dir="rtl"],
.urdu,
.urdu-inline,
.question.urduq,
.answer.urdua,
.alphabet-table td:nth-child(1),
.alphabet-table td:nth-child(3) {
    font-family: "Lateef", "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif !important;
    font-synthesis: none;
}

@media (min-width: 651px) {
    body.lesson-01 .urdu.big,
    body.lesson-01 .lesson-one-display {
        font-size: 58px !important;
        line-height: 1.45 !important;
    }

    body.lesson-01 .lesson-one-letters {
        font-size: 46px !important;
        line-height: 1.5 !important;
    }

    body.lesson-01 .alphabet-table td:nth-child(1),
    body.lesson-01 .alphabet-table td:nth-child(3) {
        font-size: 38px !important;
        line-height: 1.35 !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

@media (max-width: 650px) {
    body.lesson-01 .alphabet-table td:nth-child(1),
    body.lesson-01 .alphabet-table td:nth-child(3) {
        font-size: 30px !important;
        line-height: 1.35 !important;
    }
}
/* LATEEF-TABLE-FIX-END */


/* MYELM-AUDIO-BUTTON-CSS-START */
.audio-button-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 10px;
}

.audio-button-wrap:empty {
    display: none;
    min-height: 0;
    margin: 0;
}

.audio-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--b);
    border-radius: 999px;
    background: var(--gl);
    color: var(--gd);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.audio-play-btn:hover,
.audio-play-btn.playing {
    background: var(--g);
    border-color: var(--g);
    color: #fff;
}

.audio-play-btn:hover {
    transform: translateY(-1px);
}

.audio-play-btn.audio-error {
    background: #fff0ef;
    border-color: #b42318;
    color: #b42318;
}

.audio-play-icon {
    font-size: 16px;
    line-height: 1;
}
/* MYELM-AUDIO-BUTTON-CSS-END */

/* BEGIN MYELM LARGE LESSON IMAGES */

html body main.wrap .grid article.example .media-slot,
html body main.wrap .grid .example .media-slot,
html body main.wrap article.example .media-slot {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
}

html body main.wrap .grid article.example .media-slot img.lesson-picture,
html body main.wrap .grid .example .media-slot img.lesson-picture,
html body main.wrap article.example .media-slot img.lesson-picture,
html body main.wrap .example img.lesson-picture {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

html body main.wrap section.card .quiz-media,
html body main.wrap .quiz-media {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}

html body main.wrap section.card .quiz-media img.lesson-picture,
html body main.wrap .quiz-media img.lesson-picture {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

html body main.wrap .reviewmedia img.lesson-picture {
    display: block !important;
    width: 80% !important;
    max-width: 80% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

@media (max-width: 799px) {
    html body main.wrap .grid article.example .media-slot img.lesson-picture,
    html body main.wrap .grid .example .media-slot img.lesson-picture,
    html body main.wrap article.example .media-slot img.lesson-picture,
    html body main.wrap .example img.lesson-picture,
    html body main.wrap .quiz-media img.lesson-picture {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

@media (min-width: 800px) {
    html body main.wrap .grid article.example .media-slot img.lesson-picture,
    html body main.wrap .grid .example .media-slot img.lesson-picture,
    html body main.wrap article.example .media-slot img.lesson-picture,
    html body main.wrap .example img.lesson-picture,
    html body main.wrap .quiz-media img.lesson-picture {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* END MYELM LARGE LESSON IMAGES */

/* START MNK ALL QUIZ PICTURE AND ENGLISH FIX V2 */

/*
 * These rules affect quiz media only.
 * The final exact size is copied from the matching lesson card by JavaScript.
 * No font family is changed here.
 */
.quiz-media,
#quizMedia.quiz-media {
    box-sizing: border-box !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.quiz-media img.lesson-picture,
#quizMedia.quiz-media img.lesson-picture {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.mnk-quiz-english,
#quizEnglish.quiz-english {
    display: block;
    margin: 7px 0 14px;
    text-align: center;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    color: inherit;
}

.mnk-quiz-english:empty,
#quizEnglish.quiz-english:empty {
    display: none;
}

/* END MNK ALL QUIZ PICTURE AND ENGLISH FIX V2 */

/* START MNK QUIZ OPTION CARD FONT FIX V1 */

/*
 * Fallback only. JavaScript copies the exact matching card font size
 * whenever a quiz question is displayed.
 */
.answers button,
.options button,
.quiz-options button,
.quiz-answers button,
button.answerbtn,
button.option,
button.quiz-option,
.answer-option {
    font-family: inherit;
    font-size: 1.25rem;
    line-height: 1.5;
}

/* END MNK QUIZ OPTION CARD FONT FIX V1 */

/* START MNK MOBILE QUIZ COMPACT FIX V1 */

@media (max-width: 680px) {
    /*
     * Make the answer containers compact without changing desktop.
     */
    #quizCard .answers,
    #quizCard .options,
    #quizCard .quiz-options,
    #quizCard .quiz-answers,
    #quiz-section .answers,
    #quiz-section .options,
    #quiz-panel .answers,
    #quiz-panel .options,
    #quizPanel .answers,
    #quizPanel .options,
    .quiz-panel .answers,
    .quiz-panel .options {
        gap: 5px !important;
    }

    #quizCard .answers button,
    #quizCard .options button,
    #quizCard .quiz-options button,
    #quizCard .quiz-answers button,
    #quizCard button.answerbtn,
    #quizCard button.option,
    #quizCard button.quiz-option,
    #quizCard .answer-option,
    #quiz-section .answers button,
    #quiz-section .options button,
    #quiz-section button.answerbtn,
    #quiz-section button.option,
    #quiz-panel .answers button,
    #quiz-panel .options button,
    #quizPanel .answers button,
    #quizPanel .options button,
    .quiz-panel .answers button,
    .quiz-panel .options button {
        padding: 5px 8px !important;
        min-height: 0 !important;
        margin: 0 !important;
        line-height: 1.25 !important;
    }

    /*
     * Tighten only the quiz area, not normal lesson cards.
     */
    #quizCard,
    #quiz-section,
    .quiz-panel {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    #quizCard p,
    #quiz-section p,
    .quiz-panel p {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
    }

    #quizCard h2,
    #quizCard h3,
    #quiz-section h2,
    #quiz-section h3,
    .quiz-panel h2,
    .quiz-panel h3 {
        margin-top: 6px !important;
        margin-bottom: 7px !important;
    }

    .mnk-quiz-english,
    #quizEnglish.quiz-english {
        margin-top: 4px !important;
        margin-bottom: 7px !important;
    }
}

/* END MNK MOBILE QUIZ COMPACT FIX V1 */

/* START MNK ALL TABLES FIT SCREEN V1 */

table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse;
}

table th,
table td {
    box-sizing: border-box;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    padding: clamp(4px, 1.2vw, 10px) !important;
}

.table-wrap,
.gender-table-wrap,
.adjective-table-wrap,
.number-table-wrap,
[class*="table-wrap"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important;
}

@media (max-width: 680px) {
    table {
        font-size: clamp(10px, 2.8vw, 13px) !important;
    }

    table th,
    table td {
        padding: 4px 3px !important;
        line-height: 1.25 !important;
    }

    table .urdu,
    table [lang="ur"] {
        font-size: clamp(16px, 4.5vw, 21px) !important;
        line-height: 1.35 !important;
    }

    table .audio-play-btn {
        padding: 4px 5px !important;
        min-width: 0 !important;
    }

    table .audio-play-label {
        display: none !important;
    }
}

/* END MNK ALL TABLES FIT SCREEN V1 */

/* quiz-feedback-standard-v2:start */
#quizAnswers button,
.quiz-answers button,
.answers button,
.answerbtn{
    opacity:1;
}

#quizAnswers button:disabled,
.quiz-answers button:disabled,
.answers button:disabled,
.answerbtn:disabled{
    opacity:1 !important;
}

#quizAnswers button.correct,
.quiz-answers button.correct,
.answers button.correct,
.answerbtn.correct,
.quiz-option.correct,
.quiz-answer.correct{
    background:#e7f8ed !important;
    background-color:#e7f8ed !important;
    border-color:#1d8a55 !important;
    color:#173f2a !important;
    box-shadow:0 0 0 1px rgba(29,138,85,.08) inset !important;
}

#quizAnswers button.wrong,
.quiz-answers button.wrong,
.answers button.wrong,
.answerbtn.wrong,
.quiz-option.wrong,
.quiz-answer.wrong{
    background:#fff0ef !important;
    background-color:#fff0ef !important;
    border-color:#d98f88 !important;
    color:#6d1b16 !important;
    box-shadow:0 0 0 1px rgba(180,35,24,.05) inset !important;
}

#quizReview .review-item,
#quizReview .quiz-mistake,
#quizReview .mistake-item,
.quiz-review .review-item,
.quiz-results .review-item{
    display:block !important;
    padding:12px !important;
    margin:10px 0 0 !important;
    border:1px solid #efb4af !important;
    border-radius:12px !important;
    background:#fff5f4 !important;
    background-color:#fff5f4 !important;
    color:#54201c !important;
}

#quizReview .review-item p,
#quizReview .quiz-mistake p,
#quizReview .mistake-item p{
    margin:5px 0 !important;
}

#quizAnswers button,
.quiz-answers button,
.answers button,
.answerbtn{
    transition:
        background-color .18s ease,
        border-color .18s ease,
        color .18s ease !important;
}
/* quiz-feedback-standard-v2:end */
