/* Imam Academy v11.2.0 — Interactive Quran Error Marking, Stage 2 */
.qmark-panel{margin:10px 0 14px;border:1px solid color-mix(in srgb,var(--gm,#2f7d55) 28%,transparent);border-radius:16px;padding:11px;background:color-mix(in srgb,var(--gm,#2f7d55) 6%,var(--card,#fff));font-family:Arial,Tahoma,sans-serif}.qmark-panel-top{display:flex;align-items:end;gap:8px;flex-wrap:wrap}.qmark-toggle{border:1px solid var(--gm,#2f7d55);background:transparent;color:var(--gm,#2f7d55);border-radius:12px;padding:9px 12px;font-weight:800;cursor:pointer}.qmark-toggle.active{background:var(--gm,#2f7d55);color:#fff}.qmark-panel label{display:flex;flex-direction:column;gap:4px;min-width:210px;flex:1}.qmark-panel label span{font-size:10px;color:var(--mut,#728078);font-weight:700}.qmark-panel select{height:38px;border:1px solid var(--br,#dbe2dc);border-radius:10px;background:var(--card,#fff);color:var(--txt,#173022);padding:0 9px}.qmark-count{font-size:11px;font-weight:800;border-radius:999px;padding:7px 10px;background:var(--card,#fff);color:var(--mut,#66756c);white-space:nowrap}.qmark-hint{font-size:11px;color:var(--mut,#6f7d74);margin-top:8px;line-height:1.6}.qmark-legend{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.qmark-legend span{font-size:9px;font-weight:800;border-radius:999px;padding:4px 8px}.qmark-legend .pronunciation{background:#ffe2d7;color:#8b3521}.qmark-legend .memory{background:#fff0bf;color:#755512}.qmark-legend .tajweed{background:#dceaff;color:#2d5187}.qmark-legend .resolved{background:#daf2e0;color:#27633a}
#quranVerseContent.qmark-enabled .qmark-word{cursor:pointer}.qmark-word{position:relative;display:inline;border:0;background:transparent;color:inherit;font:inherit;line-height:inherit;padding:1px 2px;margin:0;border-radius:5px;appearance:none;-webkit-appearance:none}.qmark-word:focus-visible{outline:2px solid var(--gm,#2f7d55);outline-offset:2px}.qmark-word.qmark-pronunciation{background:#ffe1d7;box-shadow:inset 0 -3px #db6a4a}.qmark-word.qmark-memory{background:#fff0bd;box-shadow:inset 0 -3px #c69b35}.qmark-word.qmark-tajweed{background:#dce9ff;box-shadow:inset 0 -3px #5d83c4}.qmark-word.qmark-resolved{background:#def1e2;box-shadow:inset 0 -3px #4d9b62}.qmark-word[data-qmark-count]:after{content:attr(data-qmark-count);position:absolute;top:-9px;left:-4px;min-width:14px;height:14px;padding:0 2px;border-radius:999px;background:#8b2e2e;color:#fff;font:700 8px/14px Arial;text-align:center}.qmark-word.qmark-resolved[data-qmark-count]:after,.qmark-word.qmark-all-resolved[data-qmark-count]:after{background:#347a49}
.qmark-sheet[hidden]{display:none!important}.qmark-sheet{position:fixed;z-index:22000;inset:0;display:grid;align-items:end;direction:rtl}.qmark-sheet-backdrop{position:absolute;inset:0;background:rgba(5,16,10,.48);opacity:0;transition:.16s}.qmark-sheet-card{position:relative;z-index:1;width:min(720px,100%);max-height:min(82vh,720px);overflow:auto;margin:0 auto;background:var(--card,#fff);color:var(--txt,#142a1d);border-radius:22px 22px 0 0;padding:15px max(15px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(15px,env(safe-area-inset-left));transform:translateY(25px);opacity:0;transition:.16s;box-shadow:0 -20px 60px rgba(0,0,0,.2)}.qmark-sheet.open .qmark-sheet-backdrop{opacity:1}.qmark-sheet.open .qmark-sheet-card{transform:none;opacity:1}.qmark-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.qmark-sheet-head>div{display:flex;flex-direction:column;gap:3px}.qmark-sheet-head small{font-size:10px;color:var(--mut,#6f7c73)}.qmark-sheet-head b{font-family:"Amiri","Noto Naskh Arabic",serif;font-size:25px}.qmark-sheet-head button{width:38px;height:38px;border:0;border-radius:12px;background:var(--bg,#f2f5f1);color:inherit;cursor:pointer}.qmark-sheet-context{display:flex;justify-content:space-between;gap:10px;margin:10px 0;padding:9px 11px;border-radius:12px;background:var(--bg,#f5f7f3);font-size:11px}.qmark-types{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.qmark-type{border:1px solid var(--br,#dde3de);border-radius:11px;padding:10px 5px;background:var(--card,#fff);font:700 11px Arial;color:inherit;cursor:pointer}.qmark-type.pronunciation{border-color:#e4a08a;background:#fff3ee}.qmark-type.memory{border-color:#dfc87f;background:#fff9e7}.qmark-type.tajweed{border-color:#9fb9e1;background:#f1f6ff}.qmark-current{margin-top:13px;border-top:1px solid var(--br,#e0e5e1);padding-top:11px}.qmark-current-head{display:flex;justify-content:space-between;align-items:center;font-size:11px}.qmark-current-item{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--br,#edf0ed)}.qmark-current-item>div:first-child{display:flex;flex-direction:column;gap:2px}.qmark-current-item small{font-size:9px;color:var(--mut,#748078)}.qmark-current-item.resolved b{text-decoration:line-through;opacity:.7}.qmark-current-item button{border:1px solid var(--br,#dce2dd);background:var(--bg,#f6f8f5);color:inherit;border-radius:9px;padding:7px 8px;font-size:9px;font-weight:800;cursor:pointer}.qmark-current-item button.danger{color:#a03b32}.qmark-empty{text-align:center;color:var(--mut,#748078);font-size:10px;padding:10px}
.error-log-item.qmark-rich{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.error-log-item.qmark-rich small{font-size:9px;color:var(--mut,#748078)}.error-log-item.qmark-rich.resolved{opacity:.68}.error-log-item .qmark-status{font-size:8px;border-radius:999px;padding:2px 5px;background:#dff0e2;color:#2e6f40}
@media(max-width:620px){.qmark-panel-top{align-items:stretch}.qmark-toggle{width:100%}.qmark-panel label{min-width:0;width:100%}.qmark-count{align-self:flex-start}.qmark-types{grid-template-columns:repeat(3,minmax(0,1fr))}.qmark-sheet-card{max-height:86vh}.qmark-current-item{align-items:flex-start;flex-direction:column}.qmark-current-item>div:last-child{display:flex;gap:6px;width:100%}.qmark-current-item button{flex:1}}
@media(prefers-color-scheme:dark){.qmark-legend .pronunciation{background:#4b2820;color:#ffd7ca}.qmark-legend .memory{background:#44391c;color:#ffeab0}.qmark-legend .tajweed{background:#223452;color:#d5e4ff}.qmark-legend .resolved{background:#203f2a;color:#d7f1df}.qmark-word.qmark-pronunciation{background:#503026;color:#fff}.qmark-word.qmark-memory{background:#4a3c1c;color:#fff}.qmark-word.qmark-tajweed{background:#243956;color:#fff}.qmark-word.qmark-resolved{background:#22452e;color:#fff}.qmark-type.pronunciation{background:#3b251f}.qmark-type.memory{background:#38301d}.qmark-type.tajweed{background:#213149}}

/* v11.2.0 Stage 1.1 — high contrast + custom error entry + image share */
.qmark-share{border:1px solid #2f7d55;background:#eef8f1;color:#19583a;border-radius:12px;padding:9px 12px;font-weight:800;cursor:pointer;white-space:nowrap}
.qmark-custom-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--br,#e0e5e1)}
.qmark-custom-entry input{min-width:0;height:42px;border:1px solid #cfd9d1;border-radius:11px;background:#fff;color:#17251c;padding:0 11px;font:700 12px Arial,Tahoma,sans-serif;outline:none}
.qmark-custom-entry input:focus{border-color:#6b4ca3;box-shadow:0 0 0 3px rgba(107,76,163,.12)}
.qmark-custom-entry button{height:42px;border:1px solid #7656aa;border-radius:11px;background:#efe7fb;color:#53377b;padding:0 13px;font-weight:900;cursor:pointer}
.qmark-custom-types{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px}
.qmark-custom-types>span{font-size:9px;color:var(--mut,#748078)}
.qmark-custom-types button{border:1px solid #cbb8e9;background:#f6f0ff;color:#55397d;border-radius:999px;padding:5px 9px;font-size:9px;font-weight:800;cursor:pointer}
.qmark-legend .custom{background:#efe3ff;color:#5e3d86}
.qmark-word.qmark-custom{background:#efe3ff;box-shadow:inset 0 -3px #8a64bf}
/* Keep preset choices readable even when Android reports dark system theme. */
.qmark-type.pronunciation{background:#fff0ea!important;color:#71301f!important;border-color:#e8a58f!important}
.qmark-type.memory{background:#fff7d6!important;color:#624a09!important;border-color:#dcc36d!important}
.qmark-type.tajweed{background:#e9f1ff!important;color:#244b7d!important;border-color:#9db7df!important}
.qmark-type.custom{background:#f0e9ff!important;color:#583a7a!important;border-color:#c1a9e3!important}
.qmark-type:active{transform:translateY(1px)}
@media(max-width:620px){.qmark-share{width:100%}.qmark-custom-entry{grid-template-columns:1fr}.qmark-custom-entry button{width:100%}}
@media(prefers-color-scheme:dark){
  .qmark-share{background:#dff2e7;color:#174d34;border-color:#4c9a70}
  .qmark-custom-entry input{background:#fff;color:#17251c;border-color:#ccd7ce}
  .qmark-custom-entry button{background:#efe7fb;color:#53377b;border-color:#a78aca}
  .qmark-custom-types button{background:#f6f0ff;color:#55397d;border-color:#cbb8e9}
  .qmark-word.qmark-custom{background:#4a3267;color:#fff;box-shadow:inset 0 -3px #a987d0}
  .qmark-type.pronunciation{background:#fff0ea!important;color:#71301f!important}
  .qmark-type.memory{background:#fff7d6!important;color:#624a09!important}
  .qmark-type.tajweed{background:#e9f1ff!important;color:#244b7d!important}
  .qmark-type.custom{background:#f0e9ff!important;color:#583a7a!important}
}


/* v11.2.0 Stage 2 — precise character targets */
.qmark-char{position:relative;display:inline;border-radius:3px}
.qmark-char.qchar-pronunciation{box-shadow:inset 0 -3px #db6a4a}
.qmark-char.qchar-memory{box-shadow:inset 0 -3px #c69b35}
.qmark-char.qchar-tajweed{box-shadow:inset 0 -3px #5d83c4}
.qmark-char.qchar-custom{box-shadow:inset 0 -3px #8a64bf}
.qmark-char.qchar-resolved{box-shadow:inset 0 -3px #4d9b62}
.qmark-char[data-qchar-count]:after{content:"";position:absolute;left:50%;bottom:-5px;transform:translateX(-50%);width:4px;height:4px;border-radius:50%;background:#8b2e2e}
.qmark-char.qchar-resolved[data-qchar-count]:after{background:#347a49}
.qmark-char-section{margin:10px 0 12px;padding:10px;border:1px solid #d8e2da;border-radius:13px;background:#f8fbf9}
.qmark-char-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.qmark-char-head b{font-size:11px;color:#1f5038}.qmark-char-head small{font-size:9px;color:#66756c}
.qmark-char-picker{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.qmark-char-picker>div{display:flex;gap:5px;flex-wrap:wrap}
.qmark-char-choice{min-width:37px;height:38px;border:1px solid #cfd9d1;border-radius:10px;background:#fff;color:#16251b;font:800 19px "Amiri","Noto Naskh Arabic",serif;cursor:pointer;padding:0 8px}
.qmark-char-choice.whole{font:800 10px Arial,Tahoma,sans-serif;min-width:86px}
.qmark-char-choice.active{background:#17683f;color:#fff;border-color:#17683f;box-shadow:0 0 0 3px rgba(23,104,63,.12)}
.qmark-char-section p{margin:7px 0 0;color:#6e7c73;font-size:9px;line-height:1.5}
.qmark-legend .char{background:#e9f7ef;color:#216443;border:1px dashed #67a883}
@media(max-width:620px){
  .qmark-char-choice{min-width:42px;height:42px;font-size:21px}
  .qmark-char-choice.whole{width:100%;font-size:10px}
  .qmark-char-picker>div{width:100%}
}
@media(prefers-color-scheme:dark){
  .qmark-char-section{background:#f8fbf9;color:#16251b;border-color:#cad7cd}
  .qmark-char-head b{color:#1f5038}.qmark-char-head small,.qmark-char-section p{color:#5f6f64}
  .qmark-char-choice{background:#fff;color:#16251b;border-color:#c7d2ca}
  .qmark-char-choice.active{background:#17683f;color:#fff;border-color:#17683f}
  .qmark-legend .char{background:#dff2e7;color:#174d34}
}

/* v11.2.0 Stage 3 — correction-card preview */
.qmark-preview{border:1px solid #b59a49;background:#fff9e7;color:#735c16;border-radius:12px;padding:9px 12px;font-weight:800;cursor:pointer;white-space:nowrap}.qmark-preview-modal[hidden]{display:none!important}.qmark-preview-modal{position:fixed;z-index:23000;inset:0;display:grid;place-items:center;padding:16px;direction:rtl}.qmark-preview-backdrop{position:absolute;inset:0;background:rgba(4,14,9,.66)}.qmark-preview-card{position:relative;z-index:1;width:min(760px,100%);max-height:94vh;background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 25px 80px rgba(0,0,0,.32);display:grid;grid-template-rows:auto minmax(0,1fr) auto}.qmark-preview-card header{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid #e3e9e4}.qmark-preview-card header>div{display:flex;flex-direction:column}.qmark-preview-card header small{font-size:9px;color:#758178}.qmark-preview-card header b{font-size:13px;color:#174f36}.qmark-preview-card header button{width:36px;height:36px;border:0;border-radius:10px;background:#f1f4f1;color:#203328;font-size:17px}.qmark-preview-scroll{overflow:auto;padding:12px;background:#e8ede9;text-align:center}.qmark-preview-scroll img{display:block;width:min(100%,540px);height:auto;margin:auto;background:#fff;box-shadow:0 8px 30px rgba(0,0,0,.16)}.qmark-preview-card footer{display:flex;gap:8px;padding:12px 14px;border-top:1px solid #e3e9e4}.qmark-preview-card footer button{flex:1;border:1px solid #ccd6ce;background:#f6f8f6;color:#23382b;border-radius:11px;padding:10px;font-weight:900}.qmark-preview-card footer button.primary{background:#17683f;color:#fff;border-color:#17683f}@media(max-width:620px){.qmark-preview,.qmark-share{width:100%}.qmark-preview-card{max-height:92vh;border-radius:16px}.qmark-preview-card footer{padding-bottom:calc(12px + env(safe-area-inset-bottom))}}
