/* أمرتها — additions on top of the prototype styles for the live engine. */

/* English digits with Latin typography, everywhere: these faces are defined last, so for
   0-9 and % the browser picks Jost over the Arabic families. */
/* Same weight descriptors as the Thmanyah faces in assets-overrides.css, so each pair merges into one
   composite face: Jost for 0-9 % . + and Thmanyah for everything else. */
@font-face { font-family: "Thmanyah Serif Display"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 300; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 400; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 500 600; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 700; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Serif Display"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 800 900; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Sans"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 300; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Sans"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 400; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Sans"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 500 600; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Sans"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 700; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "Thmanyah Sans"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 800 900; unicode-range: U+0030-0039, U+0025, U+002E, U+002B; }
@font-face { font-family: "AmrithaNum"; src: url(assets/fonts/jost-1.woff2) format("woff2"); font-weight: 100 900; }
.num-en { font-family: "AmrithaNum", "Jost", Arial, sans-serif !important; direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; letter-spacing: 0; }
[hidden] { display: none !important; }

/* stepper numbers */
.step i.num-en { font-weight: 600; }

/* stage image: show the whole picture, not a crop */
.image-stage, .marked-image { aspect-ratio: 4 / 5; background: #0e1614; }
.image-stage img, .marked-image img { object-fit: contain; }

/* six samples */
.sample-options { flex-wrap: wrap; gap: 10px; }
.sample-option { width: 64px; height: 64px; flex-basis: 64px; }
.sample-option span { font-size: 8.5px; }

/* scanning */
.scan { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0%, rgba(216,75,61,.0) 40%, rgba(216,75,61,.35) 50%, rgba(216,75,61,0) 60%, transparent 100%); background-size: 100% 240%; animation: scan 2.2s linear infinite; mix-blend-mode: screen; }
.scan::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 28px 28px; }
@keyframes scan { from { background-position: 0 120%; } to { background-position: 0 -120%; } }

.checklog { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); }
.checklog li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); color: #9aa19e; font-size: 13px; transition: color .3s; }
.checklog li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 22px; display: grid; place-items: center; font-style: normal; font-size: 12px; }
.checklog li.on { color: var(--green); font-weight: 700; }
.checklog li.on i { border-color: var(--coral); border-top-color: transparent; animation: spin .8s linear infinite; }
.checklog li.ok { color: var(--green); }
.checklog li.ok i { background: var(--green); border-color: var(--green); color: #fff; }
.checklog li small { margin-inline-start: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* findings on the image */
.marked-image .frame { position: absolute; inset: 0; }
.overlays { position: absolute; pointer-events: none; }
.hl { position: absolute; border: 3px solid var(--coral); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(10,20,18,0); opacity: 0; transform: scale(.92); transition: opacity .25s, transform .25s, box-shadow .25s; }
.hl.is-active { opacity: 1; transform: none; box-shadow: 0 0 0 9999px rgba(10,20,18,.45); }
.dot { position: absolute; pointer-events: auto; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); color: #fff; font: 700 13px "AmrithaNum", Arial, sans-serif; display: grid; place-items: center; box-shadow: 0 3px 12px #0005; cursor: pointer; transition: transform .2s, background .2s; z-index: 2; }
.dot.off { background: #9aa19e; }
.dot.is-active { transform: scale(1.25); background: var(--green); }
.dot .tip { position: absolute; bottom: 120%; right: 50%; transform: translateX(50%); white-space: nowrap; background: var(--ink); color: #fff; font: 600 11px "Thmanyah Sans", Tahoma, sans-serif; padding: 6px 10px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.dot.is-active .tip { opacity: 1; }

/* findings list */
.issues { max-height: 470px; overflow-y: auto; }
.issue { grid-template-columns: auto auto 1fr auto; }
.issue.is-active { background: #f3f7f4; }
.issue .num { font-family: "AmrithaNum", Arial, sans-serif; font-size: 12px; }
.issue b { font-size: 14px; }
.issue small { font-size: 11px; line-height: 1.7; }
.issue .code { font-family: "AmrithaNum", Arial, sans-serif; font-size: 10px; color: var(--coral); letter-spacing: .06em; font-weight: 600; margin-inline-start: 6px; }
.conf { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 64px; }
.conf b { font-family: "AmrithaNum", Arial, sans-serif; font-size: 15px; color: var(--green); direction: ltr; }
.conf i { display: block; width: 60px; height: 4px; border-radius: 4px; background: #e4e9e6; overflow: hidden; }
.conf i::after { content: ""; display: block; height: 100%; width: var(--c, 0%); background: var(--coral); border-radius: 4px; }
.conf em { font-style: normal; font-size: 9px; color: var(--muted); }
.score strong { font-family: "AmrithaNum", Arial, sans-serif; }
.score .score-ring { transition: stroke-dashoffset 1s ease; }

/* fixing overlay */
.fixing { position: absolute; inset: 0; z-index: 6; background: rgba(6,63,56,.72); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; backdrop-filter: blur(2px); }
.fixing .spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: var(--coral); animation: spin 1s linear infinite; }
.fixing small { color: #c7d8d3; font-size: 13px; }

/* compare: follow the image's own shape */
.result-layout .compare { aspect-ratio: var(--ar, 4 / 5); background: #0e1614; }
.compare img { object-fit: contain; }
.before-wrap { inset: 0 0 0 auto !important; left: auto !important; right: 0 !important; border-left: 2px solid #fff; border-right: 0 !important; }
.before-wrap img { position: absolute; top: 0; right: 0 !important; left: auto !important; width: var(--compare-width, 100%) !important; max-width: none; height: 100%; object-fit: contain; }

/* what changed */
.result-kicker { display: block; margin-top: 22px; font-size: 12px; font-weight: 800; color: var(--coral); }
.changes { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.changes li { display: grid; grid-template-columns: auto 1fr; gap: 10px; background: #f3f6f3; border-radius: 9px; padding: 11px 12px; }
.changes li > span { font-family: "AmrithaNum", Arial, sans-serif; width: 24px; height: 24px; border-radius: 6px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.changes b { display: block; font-size: 13px; color: var(--green); }
.changes small { display: block; font-size: 11px; color: var(--muted); line-height: 1.7; margin-top: 2px; }
.action-row { flex-wrap: wrap; }
a.secondary-btn { text-decoration: none; display: inline-flex; align-items: center; }
.primary-btn:disabled { opacity: .5; cursor: progress; }

@media (max-width: 800px) {
  .issues { max-height: none; }
}

/* ---------- header tools: language, theme, accessibility ---------- */
.header-tools { display: flex; align-items: center; gap: 8px; }
.tool-btn { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(244,241,231,.35); background: transparent; color: #f4f1e7; display: inline-grid; place-items: center; cursor: pointer; font: 700 12px "Thmanyah Serif Display", "AmrithaNum", Arial, sans-serif; transition: background .2s, border-color .2s; }
.tool-btn:hover { background: rgba(244,241,231,.12); border-color: #f4f1e7; }
.tool-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn svg .fill { fill: currentColor; stroke: none; }
.tool-btn .i-sun { display: none; }
html[data-theme="dark"] .tool-btn .i-sun { display: block; }
html[data-theme="dark"] .tool-btn .i-moon { display: none; }
.lang-btn { padding: 0 14px; }
.site-header nav { margin-inline-start: auto; }
.prototype-pill { font-weight: 800 !important; font-size: 12.5px !important; letter-spacing: .01em; border-width: 1.5px !important; }
.primary-btn b { font-weight: inherit; }
html[dir="ltr"] .primary-btn span.arrow { margin-right: 0; margin-left: 20px; }
@media (max-width: 800px) { .header-tools { margin-inline-start: auto; } .tool-btn { height: 32px; min-width: 32px; } }

/* ---------- logo loader for the adjust step ---------- */
.logo-loader { position: relative; width: 300px; max-width: 70%; aspect-ratio: 3296 / 1640; margin-bottom: 6px; }
.logo-loader img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.logo-loader i { position: absolute; background: #e04b3a; border-radius: 2px; opacity: 0; }
.logo-loader .d1 { left: 91.26%; top: 9.76%; width: 3.88%; height: 7.56%; }
.logo-loader .d2 { left: 95.39%; top: 1.22%; width: 3.88%; height: 7.56%; }
.logo-loader .d3 { left: 95.39%; top: 17.8%; width: 3.88%; height: 7.56%; }
.fixing.play .logo-loader img { animation: logoIn 2.6s ease forwards; }
.fixing.play .logo-loader i { animation: dotIn .3s ease forwards, hop 1.05s ease-in-out 2.6s infinite; }
.fixing.play .logo-loader .d2 { animation-delay: 0s, 2.75s; }
.fixing.play .logo-loader .d3 { animation-delay: 0s, 2.9s; }
@keyframes logoIn { 0% { opacity: 0; transform: scale(.96); } 30% { opacity: 1; transform: none; } 62% { opacity: 1; } 100% { opacity: 0; } }
@keyframes dotIn { to { opacity: 1; } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-140%) rotate(45deg); } 55% { transform: translateY(0) rotate(90deg); } }
.fixing b { font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .fixing.play .logo-loader img { animation: none; opacity: 1; } .fixing.play .logo-loader i { animation: dotIn .3s forwards; } }

/* ---------- reviewed sample note ---------- */
.reviewed { margin-top: 4px !important; font-size: 11.5px !important; color: var(--green-2) !important; font-weight: 700; }
.reviewed::before { content: "✓ "; color: var(--coral); }

/* ---------- dark mode ---------- */
html[data-theme="dark"] { --cream: #0f1716; --paper: #121c1a; --ink: #f1ece0; --muted: #c9c2b3; --line: #2a3734; --green: #efe8d8; --green-2: #e6dfcd; --shadow: 0 18px 60px rgba(0,0,0,.45); color-scheme: dark; }
html[data-theme="dark"] body { background: var(--cream); color: var(--ink); }
html[data-theme="dark"] .site-header { background: #0a1312 !important; border-bottom-color: #1d2a27; }
html[data-theme="dark"] .workspace-section, html[data-theme="dark"] .challenge { background: var(--paper); }
html[data-theme="dark"] .app-shell { background: #16211f; border-color: var(--line); }
html[data-theme="dark"] .stepper { border-bottom-color: var(--line); }
html[data-theme="dark"] .step.active i { background: #063f38; border-color: #8fd0bf; color: #fff; }
html[data-theme="dark"] .quiet-btn, html[data-theme="dark"] .back-btn, html[data-theme="dark"] .secondary-btn { background: #1c2826; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .primary-btn, html[data-theme="dark"] .primary-link { background: #0b6a5d; color: #fff; }
html[data-theme="dark"] .dropzone { background: #1a2523; border-color: #3a4a46; }
html[data-theme="dark"] .dropzone:hover, html[data-theme="dark"] .dropzone.drag { background: #1f2d2a; }
html[data-theme="dark"] .upload-icon { background: #0b6a5d; }
html[data-theme="dark"] .issue .num, html[data-theme="dark"] .result-cards div, html[data-theme="dark"] .changes li { background: #1c2826; }
html[data-theme="dark"] .issue.is-active { background: #1f2d2a; }
html[data-theme="dark"] .issue em, html[data-theme="dark"] .success-badge { background: #1f3a33; color: #a6dccd; }
html[data-theme="dark"] .conf i, html[data-theme="dark"] .score circle { stroke: #2a3734; background: #2a3734; }
html[data-theme="dark"] .score .score-ring { stroke: var(--coral); }
html[data-theme="dark"] .checklog li.ok i { background: #0b6a5d; border-color: #0b6a5d; }
html[data-theme="dark"] .changes li > span { background: #0b6a5d; }
html[data-theme="dark"] .team div, html[data-theme="dark"] .who-meta span, html[data-theme="dark"] .stats-row div { background: #16211f; border-color: var(--line); }
html[data-theme="dark"] .reference, html[data-theme="dark"] .challenge-card { background: #0a2e29; }
html[data-theme="dark"] footer { background: #081210; }
html[data-theme="dark"] .toast { background: #e8eee9; color: #0f1716; }

/* nothing-to-adjust explanation */
.clean-list { margin-top: 10px; }
.clean-list li.na { color: var(--muted); font-weight: 500; }
.clean-list li.na i { border-style: dashed; color: var(--muted); }
.clean-tip { margin-top: 14px !important; padding: 12px 14px; border-radius: 10px; background: #f4f1e7; color: var(--ink) !important; font-size: 13px !important; }
html[data-theme="dark"] .clean-tip { background: #1c2826; }
html[data-theme="dark"] .dot.is-active { background: #0b6a5d; }
html[data-theme="dark"] .success-badge, html[data-theme="dark"] .issue em { color: #efe8d8; }
html[data-theme="dark"] .conf b, html[data-theme="dark"] .result-cards span { color: #f1ece0; }

/* ---------- image / video switch ---------- */
.media-switch { display: flex; justify-content: center; gap: 6px; padding: 18px 20px 0; }
.media-switch button { display: inline-flex; align-items: center; gap: 9px; border: 1.5px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 10px 22px; font: 700 15px inherit; font-family: inherit; cursor: pointer; transition: .2s; }
.media-switch button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.media-switch button:hover { border-color: var(--green); color: var(--green); }
.media-switch button.on { background: var(--green); border-color: var(--green); color: #fff; }
.media-switch .new-pill { font-style: normal; font-size: 10px; background: var(--coral); color: #fff; border-radius: 999px; padding: 2px 8px; }
html[data-theme="dark"] .media-switch button.on { background: #efe8d8; border-color: #efe8d8; color: #0e1614; }

/* video in the stage, the check and the compare */
.image-stage video, .marked-image video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0e1614; }
.video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #c9c2b3; }
.video-empty svg { width: 54px; height: 54px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.video-empty b { font-size: 14px; }
.compare video { width: 100%; height: 100%; object-fit: contain; display: block; }
.compare > video.after { position: absolute; inset: 0; }
.before-wrap video { position: absolute; top: 0; right: 0; width: var(--compare-width, 100%); max-width: none; height: 100%; object-fit: contain; }
.compare.single .before-wrap, .compare.single .compare-line, .compare.single .before-tag, .compare.single .after-tag, .compare.single input { display: none !important; }
.frame-chip { position: absolute; background: rgba(14, 22, 20, .78); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; pointer-events: none; z-index: 2; }
.video-checks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.video-checks li { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: baseline; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.video-checks b { color: var(--green); font-size: 14px; }
.video-checks span { color: var(--muted); font-size: 13px; line-height: 1.7; }
.issue .kind-tag { display: inline-block; margin-inline-start: 8px; font-size: 10px; font-weight: 700; color: var(--green); background: rgba(6, 63, 56, .08); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.issue.speech .num { background: var(--coral); color: #fff; }
.transcript { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.transcript summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: 13px; }
.transcript p { margin: 10px 0 2px; white-space: pre-wrap; max-height: 180px; overflow: auto; color: var(--ink) !important; font-size: 14px !important; }
.seg-note { font-size: 12px !important; margin-top: 10px; }
.script-box { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(6, 63, 56, .04); }
.script-box p { color: var(--ink) !important; font-size: 15px !important; line-height: 1.9 !important; white-space: pre-wrap; margin: 8px 0; max-height: 220px; overflow: auto; }
.script-box small { display: block; color: var(--muted); font-size: 12px; }
.script-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.script-links a { text-decoration: none; font-size: 12px; padding: 9px 14px; }
.fix-hint { display: block; margin-top: 6px; opacity: .8; }
body.mode-video .result-layout .compare { width: min(100%, calc(74vh * var(--ar, 16 / 9))); margin-inline: auto; }
body.mode-video .result-layout { height: auto !important; min-height: 0 !important; align-items: start; }
body.mode-video .result-summary { height: auto !important; max-height: none !important; overflow: visible !important; }
@media (min-width: 801px) {
  .app-shell { height: auto !important; }
  body.mode-video .panel.active[data-panel="correct"], body.mode-video .panel.active[data-panel="inspect"] { height: auto !important; min-height: 808px; }
}

.media-switch button.soon { opacity: .55; cursor: not-allowed; }
.media-switch button.soon:hover { border-color: var(--line); color: var(--muted); }
.media-switch button.soon .new-pill { background: var(--muted); }

/* two correct results */
.issues .choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 44px 14px 4px; border-bottom: 1px solid var(--line); margin-top: -6px; }
.issues .choices small { font-size: 12px; color: var(--muted); margin-inline-end: 4px; }
.issues .choices button { font: 600 13px inherit; font-family: inherit; border: 1.5px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.issues .choices button.on { border-color: var(--green); background: var(--green); color: #fff; }
html[data-theme="dark"] .issues .choices button.on { background: #efe8d8; border-color: #efe8d8; color: #0e1614; }

/* after a file is chosen, the drop zone shrinks to one line so it does not look like a second upload slot */
.dropzone .picked { display: none; }
.dropzone.has-file { min-height: 0; flex-direction: row; padding: 14px 18px; margin: 18px 0 14px; border-style: solid; gap: 10px; justify-content: flex-start; }
.dropzone.has-file .upload-icon, .dropzone.has-file > b, .dropzone.has-file > small { display: none; }
.dropzone.has-file .picked { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 14px; }
.dropzone.has-file .picked i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.dropzone.has-file .picked em { font-style: normal; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; direction: ltr; text-align: start; }
.dropzone.has-file .picked u { text-decoration: none; color: var(--green); font-weight: 700; }
html[data-theme="dark"] .dropzone.has-file .picked u { color: #efe8d8; }
