/* مراجعة النطق — standalone review tool. RTL, phone-first, light + dark, Almarai bundled (fonts/). */
@font-face { font-family: 'Almarai'; src: url('fonts/Almarai-Light.ttf') format('truetype'); font-weight: 100 349; font-display: swap; }
@font-face { font-family: 'Almarai'; src: url('fonts/Almarai-Regular.ttf') format('truetype'); font-weight: 350 599; font-display: swap; }
@font-face { font-family: 'Almarai'; src: url('fonts/Almarai-Bold.ttf') format('truetype'); font-weight: 600 900; font-display: swap; }

:root {
  --bg: #f3f5f6; --surface: #ffffff; --surface-2: #f6f8f9; --ink: #142023; --ink-2: #33454a; --muted: #66767b; --line: #dfe5e7; --line-2: #ebeff0;
  --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #e3f4f1;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf2e1; --bad: #c42b2b; --bad-soft: #fdecec; --info: #4f46e5; --info-soft: #eef0ff;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --font: 'Almarai', 'Geeza Pro', Tahoma, sans-serif; --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1214; --surface: #151c1f; --surface-2: #1a2327; --ink: #e6eef0; --ink-2: #c2cfd2; --muted: #8a9a9e; --line: #263236; --line-2: #1f292c;
  --brand: #2dd4bf; --brand-ink: #071413; --brand-soft: #123330;
  --ok: #4ade80; --ok-soft: #11281b; --warn: #fbbf24; --warn-soft: #2c2411; --bad: #f87171; --bad-soft: #321819; --info: #8b85ff; --info-soft: #22214a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0d1214; --surface: #151c1f; --surface-2: #1a2327; --ink: #e6eef0; --ink-2: #c2cfd2; --muted: #8a9a9e; --line: #263236; --line-2: #1f292c;
  --brand: #2dd4bf; --brand-ink: #071413; --brand-soft: #123330;
  --ok: #4ade80; --ok-soft: #11281b; --warn: #fbbf24; --warn-soft: #2c2411; --bad: #f87171; --bad-soft: #321819; --info: #8b85ff; --info-soft: #22214a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; min-height: 100vh; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .between { justify-content: space-between; }
bdi, .ltr { direction: ltr; unicode-bidi: isolate; }

/* buttons + fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 38px; padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.rec { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.in { width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 9px 12px; font-size: 16px; outline: none; }
.in:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
textarea.in { resize: vertical; line-height: 1.9; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 10px; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; background: var(--surface-2); }

/* header */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand b { display: block; font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); flex: none; position: relative; }
.logo::after { content: ''; position: absolute; inset: 9px 11px; border: 3px solid var(--brand-ink); border-radius: 50% 50% 50% 0; border-bottom-color: transparent; }
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.who input { width: 130px; min-height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 15px; color: var(--ink); }

/* help */
.help { padding: 12px 16px 0; }
.help-in { max-width: 860px; margin: 0 auto; background: var(--surface); border: 1px solid var(--brand); border-radius: 16px; padding: 14px 16px; }
.help-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.help ol { padding-inline-start: 22px; margin: 8px 0; } .help li { margin: 4px 0; }
.help .note { background: var(--warn-soft); border-radius: 10px; padding: 8px 10px; }
.help .keys { color: var(--muted); font-size: 13px; }
.hint { background: var(--info-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* open screen */
main { padding: 14px 16px 90px; max-width: 1280px; margin: 0 auto; }
.open { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; }
.drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 16px; border: 2px dashed var(--line); border-radius: 18px; background: var(--surface); cursor: pointer; }
.drop svg { width: 38px; height: 38px; color: var(--brand); }
.drop.over, .drop:focus { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pk { display: grid; gap: 6px; }
.pk b { overflow-wrap: anywhere; }
.res { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* work screen */
.bar { position: sticky; top: 61px; z-index: 30; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); margin-bottom: 12px; }
.prog { flex: 1 1 220px; min-width: 0; }
.ptxt { font-size: 14px; }
.pbar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.pbar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; overflow-x: auto; max-width: 100%; }
.tabs button { border: 0; background: transparent; border-radius: 9px; padding: 7px 11px; min-height: 38px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.tabs button bdi { opacity: .8; }
.pick { min-width: 200px; flex: 1 1 200px; max-width: 360px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.layout .side { order: 2; position: sticky; top: 140px; display: grid; gap: 12px; }
.lines { order: 1; display: grid; gap: 10px; min-width: 0; }
.vcard video { width: 100%; max-height: 62vh; background: #000; border-radius: 12px; display: block; }
.meta { font-size: 13.5px; display: grid; gap: 4px; }
.meta b { font-weight: 700; }
.vhead { font-weight: 800; font-size: 15px; padding: 6px 2px 0; color: var(--ink-2); overflow-wrap: anywhere; }

/* one line */
.line { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.line.active { cursor: default; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.line.st-ok { border-inline-start: 5px solid var(--ok); }
.line.st-fix { border-inline-start: 5px solid var(--warn); }
.line.st-unsure { border-inline-start: 5px solid var(--info); }
.lh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lh .sp { flex: 1; }
.n { font-weight: 800; min-width: 30px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 1px 6px; }
.time { font-family: var(--mono); font-size: 12px; color: var(--muted); direction: ltr; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 9px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.play svg { width: 18px; height: 18px; }
.play.on { background: var(--warn); }
.words { font-size: 21px; line-height: 2.1; margin: 6px 0 2px; overflow-wrap: anywhere; }
.w { border-radius: 8px; padding: 0 3px; cursor: pointer; border-bottom: 2px dotted transparent; }
.w:hover { background: var(--brand-soft); }
.w.bad { background: var(--bad-soft); color: var(--bad); border-bottom-color: var(--bad); }
.w.sel { outline: 2px solid var(--brand); }
.heard { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.why { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sum { font-size: 13.5px; margin-top: 6px; padding: 6px 10px; border-radius: 10px; overflow-wrap: anywhere; }
.sum.new { background: var(--brand-soft); }
.sum.note { background: var(--info-soft); }
.sts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sts button { flex: 1 1 0; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 800; cursor: pointer; font-size: 14px; padding: 4px 6px; }
.sts button.on[data-s="ok"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.sts button.on[data-s="fix"] { background: var(--warn); border-color: var(--warn); color: #fff; }
.sts button.on[data-s="unsure"] { background: var(--info); border-color: var(--info); color: #fff; }
:root[data-theme="dark"] .sts button.on { color: #0d1214 !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sts button.on { color: #0d1214 !important; } }
.ed { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: grid; gap: 10px; cursor: default; }
.ed label.f { font-size: 13px; color: var(--muted); font-weight: 700; }
.ed textarea.tx { font-size: 20px; min-height: 64px; }
.tash { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tash button { min-width: 46px; min-height: 46px; font-size: 26px; line-height: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 6px; }
.tash button small { font-size: 10px; color: var(--muted); }
.tash button:hover { border-color: var(--brand); }
.wfix { border: 1px solid var(--bad); background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); border-radius: 14px; padding: 10px; display: grid; gap: 8px; }
.wfix .wtitle { font-weight: 800; }
.wfix .in.say { font-size: 20px; }
.vns { display: grid; gap: 6px; }
.vn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.vn audio { height: 36px; flex: 1 1 180px; min-width: 0; max-width: 100%; }
.vn .lbl { font-size: 12.5px; color: var(--muted); }
.navs { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }

/* select2 in our colors */
.select2-container { font-family: var(--font); max-width: 100%; }
.select2-container--default .select2-selection--single { height: 44px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ink); line-height: 42px; padding-right: 13px; padding-left: 34px; font-size: 14px; width: 100%; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--muted) transparent transparent transparent; }
.select2-dropdown { background: var(--surface); border: 1px solid var(--line) !important; border-radius: 12px !important; box-shadow: 0 12px 34px rgba(0,0,0,.18); overflow: hidden; color: var(--ink); z-index: 80; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 8px 11px; font-family: var(--font); }
.select2-results__option { padding: 9px 12px; font-size: 14px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--brand-soft); color: var(--brand); }
.select2-container--default .select2-results__option--selected { background: var(--surface-2); font-weight: 700; }

#toasts { position: fixed; bottom: 16px; inset-inline: 16px; display: grid; gap: 8px; justify-items: center; z-index: 90; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: 520px; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout .side { order: 0; position: static; }
  .vcard video { max-height: 46vh; }
  .bar { top: 0; position: static; }
  .meta { display: none; }
}
@media (max-width: 560px) {
  .top { padding: 8px 12px; position: static; }
  .tabs { flex-wrap: wrap; overflow: visible; } .tabs button { flex: 1 1 auto; }
  .who input { width: 104px; }
  main { padding: 10px 12px 90px; }
  .acts { width: 100%; } .acts .btn { flex: 1 1 auto; }
  .pick { max-width: none; }
  .grid2 { grid-template-columns: 1fr; }
  .words { font-size: 20px; }
  .tash button { min-width: 44px; }
}
