/* AI Qari tutor tab — all classes prefixed .tt- */
.tt [hidden] { display: none !important; }   /* .row / buttons set display, keep the hidden attribute working */
.tt .tt-head b { color: var(--gold); font-size: 15.5px; }
.tt .tt-head .note { margin: 4px 0 8px; }
.tt-modes { display: flex; gap: 6px; margin: 4px 0 6px; }
.tt-modes button { flex: 1; padding: 8px 4px; }
.tt-range { margin: 2px 0 6px; }
.tt-sm { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tt-set { background: var(--card); border: 1px solid #ffffff1c; border-radius: 10px; padding: 4px 10px; margin: 6px 0; }
.tt-set summary { cursor: pointer; color: var(--gold); padding: 4px 0; }
.tt-set .row select { flex: 1; min-width: 0; }
.tt-prep { margin: 6px 0; }
.tt-bar { height: 8px; background: #ffffff18; border-radius: 6px; overflow: hidden; }
.tt-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.tt-preprow { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tt-preprow span { flex: 1; }
.tt-preprow button { font-size: 12.5px; padding: 4px 8px; }

.tt-stage { position: relative; min-height: 150px; }
.tt-top { display: flex; justify-content: space-between; color: var(--gold); font-size: 13px; margin-bottom: 4px; }
.tt-words { direction: rtl; text-align: center; line-height: 2.25; font-size: 30px;
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif; color: var(--text); min-height: 70px; word-spacing: 2px; }
body.light .tt-words { color: #1b2a22; }
.tt-empty { font-family: "Segoe UI", Tahoma, sans-serif; font-size: 15px; color: var(--muted); }
.tt-w { display: inline-block; padding: 0 6px; margin: 2px 1px; border-radius: 10px; border: 2px solid transparent;
  transition: background .25s, color .25s; line-height: 1.75; }
.tt-w.tt-hid { color: transparent; background: var(--btn); text-shadow: none; }
.tt-w.tt-first { color: var(--muted); background: #ffffff10; }
.tt-w.tt-vis { color: var(--muted); }
body.light .tt-w.tt-vis, body.light .tt-w.tt-first { color: #5d6f64; }
.tt-w.tt-ok { color: #3fd07a; background: #2f7d4f26; }
body.light .tt-w.tt-ok { color: #1f7a44; background: #2f7d4f22; }
.tt-w.tt-bad { color: #fff; background: #b8433a; border-color: #ff8a80; animation: tt-shake .35s 2; }
.tt-w.tt-hint { color: #2b2200; background: #e0b84a; }
.tt-w.tt-ok.tt-f-b { box-shadow: inset 0 -3px 0 #e05a4f; }
.tt-w.tt-ok.tt-f-h { box-shadow: inset 0 -3px 0 #e0b84a; }
.tt-w.tt-ok.tt-f-w { box-shadow: inset 0 -3px 0 #e08a3a; color: #e8a25a; }
.tt-w.tt-wait { border-color: var(--gold); animation: tt-pulse 1.1s ease-in-out infinite; }
.tt-num { display: inline-block; min-width: 1.6em; padding: 0 .25em; font-size: 18px; line-height: 1.6em; border: 2px solid var(--gold);
  border-radius: 50%; color: var(--gold); text-align: center; vertical-align: middle; font-family: "Segoe UI", Tahoma, sans-serif; }
@keyframes tt-pulse { 50% { box-shadow: 0 0 0 4px #d4af3755; } }
@keyframes tt-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.tt-fix { margin: 8px 0 2px; padding: 8px; border-radius: 10px; background: #8a3a3222; border: 1px solid #b8433a88; text-align: center; }
.tt-fix-h { color: #ff9a8f; font-weight: 600; font-size: 13.5px; }
body.light .tt-fix-h { color: #a3342b; }
.tt-fix-w { font-size: 38px; line-height: 1.8; color: var(--text); direction: rtl; }
body.light .tt-fix-w { color: #1b2a22; }
.tt-diff { direction: rtl; font-family: "Traditional Arabic", "Amiri", serif; font-size: 30px; line-height: 1.7; letter-spacing: 1px; }
.tt-diff .tt-d-same { color: #3fd07a; }
body.light .tt-diff .tt-d-same { color: #1f7a44; }
.tt-diff .tt-d-sub { color: #ff6b5e; text-decoration: underline wavy #ff6b5e; }
.tt-diff .tt-d-del { color: #ffb347; text-decoration: underline; text-decoration-thickness: 3px; }
.tt-diff .tt-d-ins { color: var(--muted); text-decoration: line-through; font-size: 22px; }
.tt-fix-tr { font-size: 12.5px; color: var(--muted); margin: -4px 0 4px; }
.tt-why { font-size: 13px; color: var(--text); margin: 2px 0 4px; }
.tt-fix-heard { font-size: 13px; color: var(--muted); }
.tt-fix-heard .arabic { font-size: 20px; line-height: 1.5; display: inline; }
.tt-hear { margin-top: 6px; font-size: 13px; }
.tt-heard { min-height: 1.4em; font-size: 15px; color: var(--muted); direction: rtl; text-align: center; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Traditional Arabic", "Amiri", serif; }
.tt-status { text-align: center; color: var(--gold); font-size: 13.5px; min-height: 1.5em; margin-top: 2px; }
.tt-meter { height: 6px; background: #ffffff15; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.tt-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .08s; }

.tt-ctrl button.tt-go { flex: 1; font-size: 20px; padding: 10px; }
.tt-go.tt-live { background: #a33; animation: pulse 1.2s infinite; }
.tt-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0; }
.tt-tools button { font-size: 13px; padding: 7px 4px; }
.tt button:disabled { opacity: .45; cursor: default; }
.tt-keys { text-align: center; margin: 4px 0; }

.tt-sum { background: var(--card); border: 2px solid var(--gold); border-radius: 12px; padding: 10px; margin: 10px 0; }
.tt-sum-h { text-align: center; color: var(--gold); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.tt-stats { flex-wrap: wrap; }
.tt-stats div { flex: 1 1 18%; padding: 6px 1px; }
.tt-stats b { font-size: 19px; }
.tt-mlist { max-height: 260px; overflow-y: auto; margin: 6px 0; }
.tt-skipped { margin: 6px 0; padding: 6px 8px; border-radius: 8px; border: 1px dashed var(--gold); color: var(--text); font-size: 14px; line-height: 1.7; }
.tt-mrow, .tt-crow { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-bottom: 1px solid #ffffff14; }
.tt-mw, .tt-cw { font-size: 26px; line-height: 1.6; min-width: 80px; text-align: center; direction: rtl;
  font-family: "Traditional Arabic", "Amiri", serif; color: var(--text); }
body.light .tt-mw, body.light .tt-cw { color: #1b2a22; }
.tt-mi, .tt-ci { flex: 1; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.tt-mi .arabic { font-size: 17px; line-height: 1.4; display: inline; }
.tt-mrow button, .tt-crow button { padding: 4px 8px; font-size: 14px; }
.tt-k-wrong .tt-mw { color: #ff8a80; } .tt-k-skipped .tt-mw { color: #ffb347; } .tt-k-hint .tt-mw { color: #e0b84a; }
body.light .tt-k-wrong .tt-mw { color: #a3342b; } body.light .tt-k-skipped .tt-mw, body.light .tt-k-hint .tt-mw { color: #8a6210; }
.tt-sum-btns button.wide { margin: 6px 0; }
.tt-h { margin: 12px 0 4px; color: var(--gold); }
.tt-common { background: var(--card); border-radius: 10px; padding: 4px 8px; }
.tt-honest { margin-top: 10px; border-top: 1px dashed #ffffff22; padding-top: 6px; }

/* light theme: the panel stays dark green but cards (--card) turn cream, so text/tracks on cards need dark tones */
body.light .tt-set, body.light .tt-stage, body.light .tt-sum, body.light .tt-common { color: #1b2a22; }
body.light .tt-set { border-color: #0000001f; }
body.light .tt-set summary, body.light .tt-top, body.light .tt-status, body.light .tt-sum-h,
body.light .tt-stats b, body.light .tt-num { color: #8a6a0e; }
body.light .tt-num { border-color: #b8922a; }
body.light .tt-set .row label, body.light .tt-set .note, body.light .tt-preprow, body.light .tt-sm, body.light .tt-heard,
body.light .tt-fix-heard, body.light .tt-fix-tr, body.light .tt-mi, body.light .tt-ci, body.light .tt-common .note,
body.light .tt-stats span, body.light .tt-empty { color: #55685c; }
body.light .tt-why { color: #1b2a22; }
body.light .tt-bar, body.light .tt-meter { background: #0000001c; }
body.light .tt-w.tt-first { background: #0000000d; }
body.light .tt-fix { background: #b8433a12; }
body.light .tt-diff .tt-d-sub { color: #c0392b; text-decoration-color: #c0392b; }
body.light .tt-diff .tt-d-del { color: #b35f00; }
body.light .tt-diff .tt-d-ins { color: #7a8a80; }
body.light .tt-mrow, body.light .tt-crow { border-bottom-color: #00000014; }
body.light .tt-stats div { background: #ffffffa0; border-color: #0000001a; }
body.light .tt-w.tt-wait { border-color: #b8922a; }

/* ---------------------------------------------------------------- listening styles (سننے کا انداز) */
.tt-lbl { color: var(--gold); font-size: 13px; margin: 6px 0 4px; font-weight: 600; }
.tt-styles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: #00000030; border: 1px solid #ffffff18;
  border-radius: 14px; padding: 4px; }
.tt-styles button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 1px 5px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; font-size: 11.5px; line-height: 1.25; color: var(--muted);
  transition: background .25s, color .25s, transform .15s, box-shadow .25s; }
.tt-styles button i { font-style: normal; font-size: 20px; line-height: 1.2; transition: transform .25s; }
.tt-styles button:hover { background: #ffffff10; color: var(--text); }
.tt-styles button.on { background: linear-gradient(160deg, var(--accent), #2a7a52); color: #fff; border-color: var(--gold);
  box-shadow: 0 2px 10px #0006, inset 0 0 0 1px #ffffff22; }
.tt-styles button.on i { transform: scale(1.15); }
.tt-styles button:active { transform: scale(.96); }
.tt-scard { background: var(--card); border: 1px solid #d4af3755; border-right: 4px solid var(--gold); border-radius: 12px;
  padding: 8px 10px; margin: 6px 0 8px; }
.tt-scard.tt-pop { animation: tt-pop .35s ease-out; }
@keyframes tt-pop { from { opacity: .4; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tt-scard-h { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 15px; }
.tt-scard-h i { font-style: normal; font-size: 22px; }
.tt-scard-d { margin: 3px 0 4px; font-size: 13px; line-height: 1.65; color: var(--text); }
.tt-scard[data-style=letter] { border-right-color: #5aa9e6; }
.tt-scard[data-style=exam] { border-right-color: #c08a3e; }
.tt-scard[data-style=test] { border-right-color: #b06ad8; }
.tt-sopt { margin-top: 4px; animation: tt-pop .3s ease-out; }
.tt-sopt .row select { flex: 1; min-width: 0; }
.tt-sopt .wide { margin-top: 4px; }
.tt-lprep { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.tt-lprep .tt-bar { margin-bottom: 3px; }
.tt-lprep .tt-bar i { background: linear-gradient(90deg, #5aa9e6, var(--gold)); }
.tt-seg { display: flex; gap: 4px; background: #00000026; border-radius: 10px; padding: 3px; }
.tt-seg button { flex: 1; padding: 6px 2px; font-size: 12.5px; border-radius: 8px; background: transparent; border: 1px solid transparent;
  transition: background .2s, color .2s; }
.tt-seg button.on { background: var(--accent); color: #fff; border-color: var(--gold); }
.tt-mood { margin-top: 6px; border-top: 1px dashed #ffffff1f; padding-top: 6px; }
.tt-lbl2 { display: block; font-size: 12.5px; color: var(--gold); margin-bottom: 3px; }
.tt-mood .tt-seg button[data-mood=soft].on { background: #4f8f6a; }
.tt-mood .tt-seg button[data-mood=hard].on { background: #a5473d; }
.tt-mood-d { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.tt-dim { opacity: .5; }
.tt.tt-busy .tt-styles button:not(.on) { opacity: .45; }
.tt-tools .tt-wide { grid-column: 1 / -1; }

/* word states of the new styles */
.tt-w.tt-q { border: 2px dashed #e0a24a88; }
.tt-w.tt-given { color: #d4af37; background: #d4af3722; border-color: #d4af3755; }
.tt-w.tt-focus { outline: 3px solid var(--gold); outline-offset: 1px; animation: tt-pulse 1s ease-in-out infinite; }
.tt-fix { animation: tt-pop .3s ease-out; }
.tt-fix-n { color: var(--muted); font-weight: 400; font-size: 12px; }
.tt-diff .tt-d-ins { color: #5aa9e6; text-decoration: underline dotted #5aa9e6; font-size: 26px; }
.tt-legend { font-size: 11.5px; color: var(--muted); margin: -2px 0 3px; }
.tt-legend i { font-style: normal; font-size: 13px; margin-right: 6px; }
.tt-legend .tt-d-same { color: #3fd07a; } .tt-legend .tt-d-sub { color: #ff6b5e; } .tt-legend .tt-d-del { color: #ffb347; } .tt-legend .tt-d-ins { color: #5aa9e6; }
.tt-fix.tt-drill { background: #2d5a8a22; border-color: #5aa9e688; }
.tt-fix.tt-drill .tt-fix-h { color: #8cc8ff; }
.tt-drill-w { font-size: 46px; }
.tt-drill-ok { color: #3fd07a; font-size: 16px; font-weight: 600; margin: 4px 0; animation: tt-pop .3s ease-out; }
.tt-fix.tt-cue { background: #b06ad81c; border-color: #b06ad877; }
.tt-fix.tt-cue .tt-fix-h { color: #d7a6f2; }
.tt-cue-w { font-size: 26px; line-height: 1.9; direction: rtl; color: var(--text); }

/* exam report (صفحہ سنانا) + test rounds */
.tt-grade { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px auto 2px; padding: 8px 12px; border-radius: 14px;
  width: fit-content; border: 2px solid; animation: tt-pop .45s ease-out; }
.tt-grade i { font-style: normal; font-size: 26px; }
.tt-grade b { font-size: 24px; }
.tt-grade span { font-size: 13px; opacity: .85; }
.tt-g-a { color: #ffd76a; border-color: #d4af37; background: #d4af3722; }
.tt-g-b { color: #7fe0a6; border-color: #3fa36b; background: #3fa36b22; }
.tt-g-c { color: #a6d8f5; border-color: #5aa9e6; background: #5aa9e61c; }
.tt-g-d { color: #ffc98a; border-color: #c08a3e; background: #c08a3e1c; }
.tt-g-e { color: #ff9a8f; border-color: #b8433a; background: #b8433a1c; }
.tt-grade-m { text-align: center; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.tt-xstats div { flex: 1 1 30%; }
.tt-xstats .tt-x-w b { color: #ff8a80; } .tt-xstats .tt-x-k b { color: #ffb347; } .tt-xstats .tt-x-x b { color: #5aa9e6; } .tt-xstats .tt-x-h b { color: #e0b84a; }
.tt-xmeta { text-align: center; font-size: 12px; color: var(--muted); margin: 4px 0; }
.tt-k-extra .tt-mw { color: #5aa9e6; font-size: 20px; }
.tt-clean { text-align: center; padding: 8px; color: #3fd07a; }
.tt-rounds { margin: 6px 0; display: grid; gap: 4px; }
.tt-round { display: flex; gap: 6px; align-items: center; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: #ffffff0c; }
.tt-round b { color: #d7a6f2; white-space: nowrap; }
.tt-round span:nth-child(2) { flex: 1; color: var(--muted); }
.tt-r-ok { color: #3fd07a; } .tt-r-bad { color: #ff8a80; } .tt-r-no { color: var(--muted); }

/* light theme for the new parts */
body.light .tt-styles { background: #00000022; }
body.light .tt-scard { color: #1b2a22; border-color: #b8922a66; }
body.light .tt-scard-h, body.light .tt-lbl2 { color: #8a6a0e; }
body.light .tt-scard-d, body.light .tt-grade-m { color: #1b2a22; }
body.light .tt-scard .row label, body.light .tt-mood-d, body.light .tt-lprep, body.light .tt-legend, body.light .tt-xmeta,
body.light .tt-round span:nth-child(2), body.light .tt-fix-n { color: #55685c; }
body.light .tt-scard .tt-seg { background: #0000000f; }
body.light .tt-scard .tt-seg button:not(.on) { color: #1b2a22; background: transparent; }
body.light .tt-mood { border-top-color: #0000001f; }
body.light .tt-w.tt-given { color: #8a6a0e; background: #d4af3730; }
body.light .tt-diff .tt-d-ins, body.light .tt-k-extra .tt-mw, body.light .tt-xstats .tt-x-x b { color: #1f6fb0; }
body.light .tt-legend .tt-d-same { color: #1f7a44; } body.light .tt-legend .tt-d-sub { color: #c0392b; }
body.light .tt-legend .tt-d-del { color: #b35f00; } body.light .tt-legend .tt-d-ins { color: #1f6fb0; }
body.light .tt-fix.tt-drill .tt-fix-h { color: #1f5f99; }
body.light .tt-fix.tt-cue .tt-fix-h { color: #7a3aa0; }
body.light .tt-cue-w { color: #1b2a22; }
body.light .tt-g-a { color: #8a6a0e; } body.light .tt-g-b { color: #1f7a44; } body.light .tt-g-c { color: #1f5f99; }
body.light .tt-g-d { color: #8a5a10; } body.light .tt-g-e { color: #a3342b; }
body.light .tt-round { background: #0000000a; }
body.light .tt-round b { color: #7a3aa0; }
body.light .tt-r-ok, body.light .tt-clean, body.light .tt-drill-ok { color: #1f7a44; } body.light .tt-r-bad { color: #a3342b; }
body.light .tt-xstats .tt-x-w b { color: #a3342b; } body.light .tt-xstats .tt-x-k b { color: #b35f00; } body.light .tt-xstats .tt-x-h b { color: #8a6210; }
@media (prefers-reduced-motion: reduce) { .tt-scard.tt-pop, .tt-sopt, .tt-fix, .tt-grade, .tt-drill-ok { animation: none; } }
