/* Tahfizh Challenge v141 — adaptive practice, speech, segmented feedback and celebration */
.tp141-gap{margin-top:19px!important}
.tp141-count-line{display:flex;align-items:center;gap:10px;background:linear-gradient(120deg,#f2faf3,#f8fcf8);border:1px solid #bcdbc7;border-radius:15px;padding:5px 14px;min-height:66px}
.tp141-count-line input{flex:1;min-width:30px;max-width:155px;padding:6px!important;border:0!important;background:transparent!important;outline:none!important;box-shadow:none!important;font-size:24px!important;font-weight:900;color:#0d6b4b;text-align:left}
.tp141-count-line>span{font-size:12px;color:#6b8d79;font-weight:750}
.tp141-hint{font-size:10px;color:#789180;line-height:1.7;margin:8px 0 19px}
.tp141-best{display:flex;gap:7px;align-items:center;font-size:10px;color:#186f4d;margin:11px 0 0}
.tp141-section-head{display:flex;justify-content:space-between;gap:7px;align-items:center;margin:23px 0 13px}
.tp141-section-head h2{font-size:17px!important;color:#12533d!important;line-height:1.4;margin:0!important}
.tp141-section-head>span{font-size:10px;color:#568772;font-weight:800}
.tp141-level-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.tp141-level{min-width:0;border:1px solid #d8e8d9;border-radius:15px;background:#f9fcf8;color:#236048;text-align:left;padding:13px 11px;display:grid;gap:5px;box-shadow:none;position:relative}
.tp141-level:last-child{grid-column:1/-1}
.tp141-level.selected{border:1.5px solid #129065;background:linear-gradient(135deg,#e1f8e9,#f7fff7);box-shadow:0 4px 14px #087f4617}
.tp141-level-index{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:#e6f4e8;font-size:11px;color:#17835b;font-weight:900}
.tp141-level.selected .tp141-level-index{background:#0b8760;color:white}
.tp141-level b{font-size:13px;color:#1d5c40}
.tp141-level small{color:#718b7a;font-size:10px;line-height:1.65}
.tp141-level.selected::after,.tp141-mode.selected::after{content:"✓";position:absolute;right:11px;top:11px;color:#0d8962;font-weight:900}
.tp141-modes{display:grid;gap:9px}
.tp141-mode{position:relative;text-align:left;width:100%;display:grid;grid-template-columns:40px minmax(0,1fr);grid-template-rows:auto auto;gap:2px 10px;padding:12px;border-radius:14px;background:#f9fcf9;border:1px solid #d8e8dc;align-items:center}
.tp141-mode.selected{background:#e7f8ed;border-color:#1b9871}
.tp141-mode>span{grid-row:1/3;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#e3f3e7;color:#147f59}
.tp141-mode b{font-size:12px;color:#1a6647;padding-right:20px}
.tp141-mode small{font-size:10px;color:#779281;line-height:1.45}
.tp141-sound-toggle{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:20px 0;padding:13px;border:1px solid #d9e7d9;background:#f2f8ef;border-radius:14px}
.tp141-sound-toggle>span{display:flex;gap:8px;align-items:center;font-size:11px;font-weight:800;color:#285d44}
.tp141-sound-toggle input{width:21px;height:21px;accent-color:#0d8961;flex-shrink:0}
.tp141-start{margin-top:9px}
.tp141-quiz-difficulty{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 17px}
.tp141-quiz-difficulty>span{display:inline-flex;gap:5px;align-items:center;font-size:10px;font-weight:850;border-radius:999px;color:#1a7551;background:#ecf7ee;padding:7px 10px}
.tp141-quiz-difficulty>span:first-child{color:#725a1e;background:#fff2cb}
.tp141-streak-goal{display:flex;align-items:center;gap:6px;background:#fff4da;border:1px solid #f5df9f;border-radius:12px;padding:12px 13px;color:#a06a21;font-size:11px;line-height:1.7;font-weight:750;margin:0 0 16px}
.tp139-prompt>div .tp141-play-verse{width:auto;min-width:44px;min-height:40px;padding:8px 11px;display:inline-flex;align-items:center;gap:7px;justify-content:center;white-space:nowrap;border-radius:12px;font-size:10px;font-weight:850}
.tp139-prompt>div .tp141-play-verse span{font-family:'Nunito Sans',system-ui,sans-serif;font-size:10px}
.tp141-translation-hint summary{display:inline-flex;gap:5px;color:#428b66;font-weight:750;font-size:11px;cursor:pointer;margin-top:8px}
.tp141-translation-hint>span{display:block;color:#759582;font-size:12px;line-height:1.7;padding-top:10px}
.tp141-voice-status{color:#287d59!important;font-weight:750;text-align:center;font-size:10px;line-height:1.8;padding:6px;border-radius:10px;background:#f3fbf5}
.tp141-recording{background:#fce7e3!important;border-color:#eabbbb!important;color:#b34b46!important;animation:tp141-pulse 1.5s ease-in-out infinite}
@keyframes tp141-pulse{50%{box-shadow:0 0 0 8px #f9b0a825}}
.tp141-feedback-anchor[hidden]{display:none!important}
.tp141-feedback-anchor{scroll-margin-top:calc(max(env(safe-area-inset-top),0px) + 18px);margin-top:16px}
.tp141-feedback-text{padding-top:13px;margin-top:13px;border-top:1px solid #b7dec8}
.tp141-feedback-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tp141-feedback-top>span{font-size:10px;letter-spacing:.05em;font-weight:900;color:#387957}
.tp141-feedback-top button{border:1px solid #c2dfc8;background:#fff;border-radius:12px;color:#167950;font-size:10px;display:inline-flex;gap:5px;align-items:center;padding:9px}
.tp141-marked-ayah{font-family:'Amiri',serif!important;font-size:clamp(25px,7vw,37px)!important;line-height:2.35!important;color:#154c37;text-align:right;word-spacing:5px;direction:rtl;margin:13px 0 9px!important}
.tp141-token{display:inline;padding:3px 3px;border-radius:8px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.tp141-token-exact{background:#daf1df;color:#176645}
.tp141-token-close{background:#fff0b5;color:#805c1a;border-bottom:2px solid #dda72b}
.tp141-token-wrong,.tp141-token-missing{background:#ffe0de;color:#a3342d;border-bottom:2px solid #c74e44}
.tp141-token-extra{background:#ffe1e6;color:#a13362;text-decoration:line-through}
.tp141-corrections{border-top:1px dashed #cbdccf;padding-top:12px;margin-top:12px}
.tp141-corrections>b{display:block;font-size:11px;color:#1f7751}
.tp141-corrections>p,.tp141-feedback-disclaimer{display:block;font-size:10px;line-height:1.7;color:#719180;margin:7px 0}
.tp141-corrections ul{display:grid;gap:7px;list-style:none;padding:0;margin:11px 0}
.tp141-corrections li{display:flex;justify-content:space-between;align-items:center;gap:9px;border:1px solid #e4d6bc;border-radius:10px;background:#fffaf2;padding:7px 10px}
.tp141-corrections li>span{font:normal 22px/1.9 'Amiri',serif;color:#945129}
.tp141-corrections li>small{text-align:right;font-size:10px;color:#978067}
.tp141-option-correct{background:#dff4e5!important;border-color:#248d5c!important}
.tp141-option-wrong{background:#fce1e1!important;border-color:#d07673!important}
.tp141-results{display:grid;gap:17px}
.tp141-celebration{position:relative;overflow:hidden;border-radius:20px;background:radial-gradient(circle at 50% 6%,#4fbf9188,transparent 60%),linear-gradient(137deg,#07533d,#078165);padding:28px 16px;color:white}
.tp141-medal{width:85px;height:85px;display:grid;place-items:center;border-radius:50%;background:#f0e2aa;color:#795921;margin:0 auto 14px;box-shadow:0 0 0 9px #f2f9d52e,0 7px 30px #053f2f7a;position:relative;z-index:1}
.tp141-celebration>span{font-size:10px;letter-spacing:.1em;color:#d9efc7;font-weight:900;position:relative;z-index:1}
.tp141-celebration h2{font-size:26px!important;color:white!important;margin:13px 0 10px!important;position:relative;z-index:1}
.tp141-celebration>p{font-size:12px;line-height:1.9;color:#e0f5e7;margin:0!important;position:relative;z-index:1}
.tp141-confetti{position:absolute;width:5px;height:12px;top:-18px;left:calc(3% + var(--n) * 6%);background:hsl(calc(38 + var(--n) * 18) 62% 78%);border-radius:2px;transform:rotate(calc(var(--n) * 39deg));animation:tp141-fall 4s ease-out infinite;animation-delay:calc(var(--n) * -.19s);opacity:.85;pointer-events:none}
@keyframes tp141-fall{from{transform:translateY(0) rotate(0deg)}to{transform:translateY(320px) rotate(400deg);opacity:0}}
.tp141-result-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.tp141-result-grid>div{display:grid;gap:7px;padding:12px 6px;border-radius:13px;background:#eef8ef}
.tp141-result-grid strong{font-size:18px!important;color:#08744f}
.tp141-result-grid small{font-size:10px;color:#678b73;line-height:1.5}
.tp141-streak-achieved{padding:12px;border-radius:13px;background:#fff5d7;color:#8c6325;font-size:11px;display:flex;gap:7px;align-items:center;justify-content:center}
.tp141-missed{padding:15px 12px;text-align:left;background:#f5faf5;border:1px solid #d5e8d7;border-radius:16px}
.tp141-missed h3{font-size:14px!important;color:#1b6847;margin:0 0 10px!important}
.tp141-missed>div{display:flex;gap:6px;flex-wrap:wrap;margin:7px 0 14px}
.tp141-missed>div span{font-size:10px;background:#e5efe7;border-radius:7px;padding:6px;color:#316d4a}
.tp141-missed>button{font-size:11px}
@media(max-width:400px){.tp141-level-grid{gap:7px}.tp141-level{padding:12px 9px}.tp141-section-head h2{font-size:15px!important}.tp141-feedback-top button{font-size:9px;padding:8px}}
/* Keep interactive quiz controls out of the fixed bottom-navigation hit area. */
html:has(.tp139-page){scroll-padding-bottom:calc(158px + env(safe-area-inset-bottom,0px))}
.tp139-page{padding-bottom:calc(190px + env(safe-area-inset-bottom,0px))!important}
.tp139-page button,.tp139-page input,.tp139-page textarea,.tp139-page select{scroll-margin-bottom:calc(135px + env(safe-area-inset-bottom,0px));scroll-margin-top:20px}
#tp139-start,#tp139-check,#tp139-next,#tp141-retry-wrong{scroll-margin-bottom:calc(175px + env(safe-area-inset-bottom,0px))}
@media(prefers-reduced-motion:reduce){.tp141-confetti,.tp141-recording{animation:none}}