@font-face {
  font-family: "Amiri";
  src: url("/fonts/Amiri-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #f6f5f3;
  --panel: #ffffff;
  --ink: #1f1d1b;
  --muted: #6b6661;
  --line: #e4e0db;
  --accent: #0b3b36;          /* the site's emerald */
  --accent-soft: #e7f0ed;
  --gold: #c9a24a;
  --ok: #2e7d4f;
  --ok-soft: #e3f2e8;
  --edit: #2f62b5;
  --edit-soft: #e8effa;
  /* low-confidence highlights */
  --high: #e65100;
  --high-bg: #ffd8a8;
  --med: #f59f00;
  --med-bg: #fff0d1;
  --minor: #9a948e;
  --split: 50%;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
button, select, input { font: inherit; color: inherit; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: .45; cursor: default; }
button.secondary { background: var(--panel); color: var(--accent); border: 1px solid var(--accent); }
button.ghost { background: transparent; color: var(--muted); padding: 2px 6px; }
button.ghost:hover { color: var(--accent); }
button.link { background: none; color: var(--edit); padding: 0 4px; font-size: 12px; }
button.link:hover { text-decoration: underline; }
select, input[type=text], .reviewer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
}
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ── Top bar: where you are (surah, page), progress, tools, your account ── */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 8px 16px;
  min-height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 rgba(201, 162, 74, .28);
}
.topbar > * { flex: none; }
.topbar > .spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; margin-right: 2px; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand b { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand span { font-size: 13.5px; color: var(--muted); }
.pill-select {
  -webkit-appearance: none; appearance: none;
  height: 36px; padding: 0 34px 0 14px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6661' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 13px;
  font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill-select:hover { border-color: #cfc8bf; }
#surahSelect, #sourceSelect { max-width: 240px; }
.pager { display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--bg); }
.pager .pill-select { width: 270px; border-color: transparent; box-shadow: 0 1px 2px rgba(0, 0, 0, .07); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer;
  list-style: none;
}
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); filter: none; }
.pager .icon-btn { flex: none; width: 32px; height: 32px; background: var(--panel); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.chip-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none;
}
.chip-toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip-toggle [data-icon] { display: inline-grid; }
.chip-toggle svg { width: 15px; height: 15px; }
.chip-toggle:hover { border-color: #cfc8bf; color: var(--ink); }
.chip-toggle:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.progress b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-bar { width: 72px; height: 6px; border-radius: 99px; background: #ebe6df; overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--accent)); }
.bar-tools { display: flex; align-items: center; gap: 2px; }
.bar-tools .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; list-style: none; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--gold);
}
.avatar::-webkit-details-marker, .dl-menu summary::-webkit-details-marker { display: none; }
.dl-menu summary { list-style: none; }
.topbar :is(.pill-select, .icon-btn, .avatar, button):focus-visible, .chip-toggle:has(input:focus-visible) {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
/* the menus (Download, your account) */
.acct-menu, .dl-menu { position: relative; }
.acct-menu .menu, .dl-items {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; display: grid; min-width: 230px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .15);
}
.menu-head { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head .who { font-size: 14px; font-weight: 600; color: var(--ink); }
.menu-head small { font-size: 12px; color: var(--muted); }
.menu-head small:empty { display: none; }
.acct-menu .navlink, .dl-items a, .menu-out, .menu-tools .icon-btn, .menu-tools .dl-menu summary {
  display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px 10px; border-radius: 8px;
  border: 0; background: none; font-size: 14px; font-weight: 400; color: var(--ink); text-decoration: none; text-align: left;
  white-space: nowrap; cursor: pointer;
}
.acct-menu .navlink:hover, .dl-items a:hover, .menu-out:hover, .menu-tools .icon-btn:hover, .menu-tools .dl-menu summary:hover {
  background: var(--accent-soft); color: var(--ink); text-decoration: none; filter: none;
}
.topbar [hidden], .pane-bar [hidden] { display: none !important; }   /* (the menu's links set their own display) */
.menu-out { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #9b231c; }
.menu-tools { display: grid; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.menu-tools .dl-items { position: static; box-shadow: none; border: 0; padding: 0 0 0 22px; min-width: 0; }
.reviewer { width: 140px; }

/* ── Page strip ── */
.strip {
  display: flex;
  gap: 2px;
  padding: 5px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  min-height: 22px;
}
.tick {
  flex: 1 0 6px;
  max-width: 22px;
  height: 12px;
  border-radius: 2px;
  background: #ddd8d2;
  cursor: pointer;
  position: relative;
}
.tick.pending { background: repeating-linear-gradient(45deg, #eee, #eee 2px, #ddd 2px, #ddd 4px); }
.tick.med { background: var(--med); }
.tick.high { background: var(--high); }
.tick.approved { background: var(--ok); }
.tick.edited::after {
  content: ""; position: absolute; left: 50%; top: -3px; width: 5px; height: 5px;
  margin-left: -2.5px; border-radius: 50%; background: var(--edit);
}
.tick.current { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ── Panes ── */
.panes {
  flex: 1;
  display: grid;
  grid-template-columns: var(--split) 6px 1fr;
  min-height: 0;
}
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.pane-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  min-height: 50px;
  background: #fbfaf7;
}
.pane-bar button { white-space: nowrap; }
.pane-title { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.zoom { display: inline-flex; align-items: center; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.zoom button { display: inline-flex; align-items: center; gap: 4px; height: 30px; min-width: 30px; padding: 0 8px; border: 0;
  border-radius: 999px; background: transparent; color: var(--ink); font-size: 13px; }
.zoom button:hover { background: var(--accent-soft); color: var(--accent); filter: none; }
.zoom svg { width: 16px; height: 16px; }
#zoomFit { margin-left: 2px; border-left: 1px solid var(--line); border-radius: 0 999px 999px 0; padding: 0 12px 0 10px; }
.zoom-label { width: 44px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.scroll { flex: 1; overflow: auto; min-height: 0; }
.divider { background: var(--line); cursor: col-resize; }
.divider:hover, .divider.dragging { background: var(--accent); }

.images { background: #e9e6e2; padding: 12px; text-align: center; }
.images img {
  display: block;
  margin: 0 auto 12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.img-loading { color: var(--muted); padding: 40px; }

/* ── Right pane content ── */
.content { padding: 16px 22px 80px; }
.chip {
  display: inline-block;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  margin-right: 4px;
  border: 1px solid var(--line);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.edit { background: var(--edit-soft); color: var(--edit); border-color: transparent; }
.chip.warn { background: var(--high-bg); color: #8a3000; border-color: transparent; }
.approve { height: 34px; padding: 0 16px; border-radius: 999px; background: var(--ok); font-weight: 600; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
.approve.undo, .approve.secondary { background: var(--panel); color: var(--ok); border: 1px solid var(--ok); box-shadow: none; }
.save-btn { height: 34px; padding: 0 16px; border-radius: 999px; background: var(--accent); font-weight: 600; }
.save-btn:disabled { background: transparent; color: var(--muted); border: 1px solid var(--line); opacity: 1; }
.pane-bar .icon-btn { width: 34px; height: 34px; }
.dirty-note { color: var(--edit); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

.notice {
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--edit-soft);
  border: 1px solid #c9d8f2;
}
.notice.warn { background: #fff4e5; border-color: #f3cf9b; }
.notice a { color: var(--edit); cursor: pointer; }

/* Flags panel */
.flags { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.flags > summary {
  cursor: pointer;
  padding: 8px 12px;
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
}
.flags > summary::-webkit-details-marker { display: none; }
.flags > summary::before { content: "▸"; color: var(--muted); }
.flags[open] > summary::before { content: "▾"; }
.flags .issue { border-top: 1px solid var(--line); }

.issue { padding: 8px 12px; font-size: 13px; }
.issue .head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.issue .type { font-weight: 600; }
.issue .loc { color: var(--muted); }
.issue .desc { margin-top: 3px; color: #3d3935; }
.issue .desc.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.issue .actions { margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.issue.resolved { opacity: .6; }
.issue.resolved .type { text-decoration: line-through; }
.issue.flash { animation: flash 1.2s ease; }
@keyframes flash { from { background: #fff1c2; } to { background: transparent; } }
.sev { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; color: #fff; }
.sev.HIGH { background: var(--high); }
.sev.MEDIUM { background: var(--med); }
.sev.LOW { background: var(--minor); }

/* Sections, verses, fields */
.section { margin-bottom: 22px; }
.section-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.verse {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fff;
}
.verse-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.vnum { color: var(--accent); font-family: "Amiri", serif; font-size: 20px; white-space: nowrap; }
.arabic {
  font-family: "Amiri", serif;
  font-size: 22px;
  line-height: 1.9;
  direction: rtl;
  text-align: right;
  flex: 1;
}
.arabic.small { font-size: 18px; line-height: 1.6; }

.field { position: relative; margin: 8px 0; border-left: 3px solid transparent; padding-left: 8px; }
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}
.field-label .pill { text-transform: none; letter-spacing: 0; }
.field-text {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  padding: 4px 6px;
  margin-left: -6px;
  border-radius: 6px;
  cursor: text;
  white-space: normal;
  min-height: 1.6em;
}
.field-text:hover { background: #faf8f6; outline: 1px dashed var(--line); }
.field-text p { margin: 0 0 .7em; }
.field-text p:last-child { margin-bottom: 0; }
.field-text .empty { color: var(--muted); font-style: italic; font-family: system-ui, sans-serif; font-size: 13px; }
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  padding: 6px 8px;
  border: 2px solid var(--edit);
  border-radius: 6px;
  resize: vertical;
  min-height: 3.4em;
  background: #fff;
}
.field-original {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
  white-space: pre-wrap;
}
.field-original::before { content: "Machine translation: "; font-family: system-ui, sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

.field.edited { border-left-color: var(--edit); }
.field.dirty { border-left-color: var(--edit); border-left-style: dashed; }
.field.flag-MEDIUM, .block.flag-MEDIUM { border-left-color: var(--med); background: linear-gradient(90deg, var(--med-bg), transparent 60%); }
.field.flag-HIGH, .block.flag-HIGH { border-left-color: var(--high); background: linear-gradient(90deg, var(--high-bg), transparent 60%); }
.field.flag-LOW { border-left-color: var(--minor); border-left-style: dotted; }
.verse.flag-MEDIUM { border-color: var(--med); box-shadow: inset 4px 0 0 var(--med); }
.verse.flag-HIGH { border-color: var(--high); box-shadow: inset 4px 0 0 var(--high); }
.block { border-left: 3px solid transparent; padding-left: 8px; margin: 8px 0; }

/* the orange low-confidence phrase highlight */
mark.lc { border-radius: 3px; padding: 0 1px; cursor: pointer; color: inherit; }
mark.lc.HIGH { background: var(--high-bg); box-shadow: inset 0 -2px 0 var(--high); }
mark.lc.MEDIUM { background: var(--med-bg); box-shadow: inset 0 -2px 0 var(--med); }
mark.lc.LOW { background: transparent; box-shadow: inset 0 -1px 0 var(--minor); }

.inline-issues { margin: 4px 0 2px; }
.inline-issues .issue { padding: 4px 8px; background: rgba(255,255,255,.7); border-radius: 6px; margin-top: 4px; border: 1px solid var(--line); }

.conflict {
  margin-top: 6px;
  border: 1px solid #f3cf9b;
  background: #fff4e5;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
.conflict .old { font-family: var(--serif); white-space: pre-wrap; margin: 4px 0; }

/* Word meanings */
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.wm {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
}
.wm .arabic { font-size: 17px; line-height: 1.5; display: block; }
.wm textarea {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  font-family: var(--serif);
  font-size: 14px;
  background: transparent;
}
.wm textarea:hover { border-color: var(--line); }
.wm textarea:focus { border-color: var(--edit); outline: none; background: #fff; }
.wm.edited { border-color: var(--edit); }
.wm.flag-MEDIUM { background: var(--med-bg); border-color: var(--med); }
.wm.flag-HIGH { background: var(--high-bg); border-color: var(--high); }
.wm.flag-LOW { border-style: dotted; border-color: var(--minor); }

.readonly .field-text { cursor: default; }
.readonly .field-text:hover { background: none; outline: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #2b2725;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  max-width: 80vw;
  z-index: 10;
}
.toast a { color: #ffd38a; margin-left: 8px; }
.toast.error { background: #a23b1a; }

/* Phones and narrow windows: the book page above, the text below, each
   scrolling on its own, with a handle between them to share the height;
   the bars are one row each that can be swiped sideways. (The rules for
   these are at the end of this file, after everything they override.) */

/* ── Reviewer-friendly additions ── */
body { font-size: 15px; }
.page-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pane.right .pane-bar { flex-wrap: wrap; row-gap: 6px; }   /* (a narrow column: the buttons go to a second line, nothing is cut) */
.pane-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px 4px 9px;
  border-radius: 999px; background: #fdf1de; color: #8a4b00; white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; flex: none; }
.status.ok { background: var(--ok-soft); color: var(--ok); }

button.small { padding: 3px 10px; font-size: 13px; }
button.ok-btn { background: var(--ok); }

.help {
  border: 1px solid #c9d8f2; background: var(--edit-soft); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
}
.help-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.help ol { margin: 6px 0 10px 18px; padding: 0; }
.help li { margin: 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 12px; border-radius: 3px; }
.sw.high { background: var(--high-bg); box-shadow: inset 0 -2px 0 var(--high); }
.sw.med { background: var(--med-bg); box-shadow: inset 0 -2px 0 var(--med); }
.sw.edit { background: var(--edit); width: 4px; }
.sw.ok { background: var(--ok); }
.help-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.help-foot .muted { flex: 1; font-size: 13px; }

.notice.ok { background: var(--ok-soft); border-color: #bfe0cb; }
.flags.all-done > summary b { color: var(--ok); }
.flags .general { padding: 6px 12px 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.small-text { font-size: 12px; }
.issue .type { font-weight: 600; }
.issue .desc { font-size: 13.5px; }

.edit-btn {
  background: transparent; color: var(--edit); border: 1px solid #c9d8f2;
  padding: 0 8px; font-size: 12px; border-radius: 10px; text-transform: none; letter-spacing: 0;
}
.edit-btn:hover { background: var(--edit-soft); }
.edit-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field-label .label-text { font-weight: 600; }

.book-note {
  font-size: 13px; color: #3d4b63; background: #f1f4f9; border-radius: 6px;
  padding: 6px 10px; margin: 2px 0 6px;
}
.book-note.warn { background: #fff4e5; color: #6b4400; }
.book-note a { color: var(--edit); }
.book-show-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; font-size: 12px; font-weight: 600;
  background: #fff; color: var(--accent); border: 1px solid var(--accent-soft);
  border-radius: 10px; cursor: pointer; vertical-align: baseline;
}
.book-show-btn:hover { background: var(--accent-soft); }
.field.locked .field-text { color: var(--muted); cursor: default; }
.field.locked .field-text:hover { background: none; outline: none; }
.verse.dim .arabic { opacity: .5; }

.vlabel { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.vtitle { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.field-text { font-size: 16px; }

/* ── Malayalam-style page layout ── */
.verse { border: 0; border-radius: 0; padding: 4px 0 10px; margin-bottom: 18px; background: transparent; border-bottom: 1px solid var(--line); }
.verse.flag-MEDIUM, .verse.flag-HIGH { box-shadow: none; border-color: var(--line); }
.verse.flag-MEDIUM > .panel { box-shadow: inset 4px 0 0 var(--med); }
.verse.flag-HIGH > .panel { box-shadow: inset 4px 0 0 var(--high); }
.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 6px 4px 6px 10px;
}
.panel-en {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}
.panel-en .field { margin: 0; }
.panel-ar { direction: rtl; text-align: right; font-size: 23px; line-height: 2; padding-top: 22px; }
.ar-line { white-space: normal; }
.vprefix { color: var(--accent); font-family: "Amiri", serif; font-size: 1.05em; }
.juz-heading { text-align: center; color: #b0247a; font-weight: 700; font-size: 20px; margin: 4px 0 8px; letter-spacing: .5px; }
.verse.dim .panel-ar { opacity: .5; }

.footnote {
  border-top: 1px solid #b9b2aa;
  border-bottom: 1px solid #b9b2aa;
  margin: 6px 0 10px;
  padding: 4px 6px 8px;
  border-left: 3px solid transparent;
}
.footnote.flag-MEDIUM { border-left-color: var(--med); background: linear-gradient(90deg, var(--med-bg), transparent 70%); }
.footnote.flag-HIGH { border-left-color: var(--high); background: linear-gradient(90deg, var(--high-bg), transparent 70%); }
.footnote .hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.wm-line { font-family: var(--serif); font-size: 14.5px; line-height: 2.1; }
.wmi { white-space: nowrap; border-radius: 4px; padding: 1px 2px; }
.wmi .ar { font-family: "Amiri", serif; font-size: 17px; direction: rtl; unicode-bidi: isolate; }
.wmi .dash { color: var(--muted); }
.wmi .en.editable { cursor: text; border-bottom: 1px dotted #c9c2bb; }
.wmi .en.editable:hover { background: var(--edit-soft); }
.wmi.edited .en { border-bottom: 2px solid var(--edit); }
.wmi.flag-MEDIUM .en { background: var(--med-bg); box-shadow: inset 0 -2px 0 var(--med); }
.wmi.flag-HIGH .en { background: var(--high-bg); box-shadow: inset 0 -2px 0 var(--high); }
.wm-sep { color: #b9b2aa; }
.wm-inline { font-family: var(--serif); font-size: 14.5px; border: 2px solid var(--edit); border-radius: 4px; padding: 0 4px; }
@media (max-width: 1100px) { .panel { grid-template-columns: 1fr; } .panel-ar { padding-top: 0; } }
.reviewer { width: 120px; }

/* ── Move a paragraph ── */
.field-text p .para-move {
  visibility: hidden; margin-left: 6px; padding: 0 8px; border-radius: 10px;
  font: 12px/1.6 system-ui, sans-serif; vertical-align: 2px;
  background: #fff; color: var(--edit); border: 1px solid #c9d8f2;
}
.field-text p:hover .para-move, .field-text p .para-move:focus { visibility: visible; }
.field-text p .para-move:hover { background: var(--edit-soft); }
@media (hover: none) { .field-text p .para-move { visibility: visible; } }
.modal-back { position: fixed; inset: 0; background: rgba(30, 25, 22, .38); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal { background: #fff; border-radius: 12px; padding: 18px 22px; width: min(580px, 94vw); box-shadow: 0 12px 44px rgba(0, 0, 0, .28); }
.modal-title { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.modal-quote { margin: 0 0 14px; padding: 8px 12px; background: var(--bg); border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 14.5px; max-height: 150px; overflow: auto; white-space: pre-wrap; }
.modal-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; margin: 9px 0; }
.modal-row select { width: 100%; }
.modal-row .gap { margin-left: 18px; }
.modal-status { min-height: 20px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.toast a + a { margin-left: 12px; }

/* ── Sign-in ── */
body.login-page { overflow: auto; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 30px; width: min(420px, 100%); box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}
.brand.big { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.login-card h1 { font-size: 18px; margin: 0 0 14px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0; }
.login-card input { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.login-card input:focus { outline: 2px solid var(--edit); border-color: transparent; }
.login-card button[type=submit] { width: 100%; padding: 9px; font-size: 15px; margin-top: 6px; }
.login-error { color: #a23b1a; font-size: 13px; min-height: 18px; }
.login-card [hidden] { display: none; }
.login-card code { font-size: 12px; }

/* ── ↑ ↓ ⇄ paragraph tools ── */
.para-tools { white-space: nowrap; }
.para-tools .para-move + .para-move { margin-left: 3px; }
.field-text p:hover .para-tools .para-move, .para-tools .para-move:focus { visibility: visible; }
.field-text p.flash { animation: flash 1.4s ease; border-radius: 4px; }

/* let label rows wrap cleanly in narrow columns */
.field-label { flex-wrap: wrap; row-gap: 2px; }
.field-label > * { white-space: nowrap; }

/* ── Undo + page edges ── */
#undoBtn:disabled { opacity: .4; }
.issue.done-line { display: flex; gap: 8px; align-items: center; padding: 3px 8px; background: transparent; border: 0; font-size: 12.5px; }
.edge-note { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 6px 12px; margin: 0 0 14px; }
.edge-note.mid { background: var(--edit-soft); color: #3d4b63; }
.edge-label { font-weight: 600; }
.edge-text { font-family: var(--serif); font-style: italic; }

/* ── Malayalam text check (source.html) ── */
.source-page {
  --ml: "Noto Sans Malayalam", "Malayalam Sangam MN", "Malayalam MN", "Nirmala UI", "Kartika", sans-serif;
}
.navlink, a.button { font-size: 13px; color: var(--accent); text-decoration: none; white-space: nowrap; }
a.button.secondary { border: 1px solid var(--accent); border-radius: 6px; padding: 5px 10px; background: var(--panel); cursor: pointer; }
.navlink:hover, a.button:hover { text-decoration: underline; }
.src-section { margin: 18px 0 8px; padding: 8px 12px; background: var(--accent-soft); border-radius: 8px; }
.src-section.continued { background: transparent; border: 1px dashed var(--line); padding: 5px 12px; }
.src-section-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 15px; }
.src-section-title .ml { font-family: var(--ml); }
.src-note { margin-top: 4px; font-size: 12.5px; color: #6b4a57; }
.src-part { margin: 14px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.src-verse { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--accent); }
.src-block { position: relative; padding: 6px 10px 6px 12px; margin: 2px 0 6px; border-left: 3px solid transparent; border-radius: 4px; }
.src-block:hover { background: #faf9f7; }
.src-block.flag-MEDIUM { border-left-color: var(--med); }
.src-block.flag-HIGH { border-left-color: var(--high); background: #fff8f0; }
.src-block.edited { border-left-color: var(--edit); }
.src-text { font-family: var(--ml); font-size: 16.5px; line-height: 1.9; white-space: pre-wrap; cursor: text; }
.src-text.ar-only { font-family: "Amiri", serif; font-size: 22px; direction: rtl; text-align: right; }
.k-note .src-text { font-size: 14.5px; color: #4a4642; }
.k-subhead .src-text { font-weight: 700; }
.src-label { font-family: system-ui, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-right: 8px; }
.src-text mark.lc, .w-ml mark.lc { background: var(--med-bg); box-shadow: inset 0 -2px 0 var(--med); cursor: text; }
.word-row { display: grid; grid-template-columns: minmax(120px, 38%) auto 1fr; gap: 10px; align-items: baseline; cursor: text; }
.w-ar { font-family: "Amiri", serif; font-size: 21px; text-align: right; }
.w-eq { color: var(--muted); }
.w-ml { font-family: var(--ml); font-size: 16px; line-height: 1.8; }
.k-word { padding-top: 1px; padding-bottom: 1px; margin: 0; }
.src-tools { display: none; gap: 8px; align-items: center; margin-top: 2px; font-size: 12px; }
.src-block:hover .src-tools, .src-block.edited .src-tools, .src-tools:focus-within { display: flex; }
.src-block.k-note .src-tools { display: flex; }   /* footnotes: ↑ ↓ ⇄ Move always at hand (phones have no hover) */
.src-block .src-tools .edit-btn { font-size: 12px; padding: 1px 8px; background: #fff; color: var(--edit); border: 1px solid #c9d8f2; border-radius: 10px; }
.dirty-chip { color: var(--edit); font-weight: 600; }
.src-edit { width: 100%; font-family: var(--ml); font-size: 16px; line-height: 1.8; padding: 6px 8px; border: 2px solid var(--edit); border-radius: 6px; resize: vertical; }
.src-edit.word { font-size: 16px; }
.src-original { font-family: var(--ml); font-size: 14px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 6px 10px; margin-top: 4px; white-space: pre-wrap; }
.src-original::before { content: "Original text: "; font-family: system-ui, sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.src-flags { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 13px; }
.src-flags.done { font-size: 12px; }
.src-flag { flex: 1 1 100%; }
.sev.med { background: var(--med); }
.sev.high { background: var(--high); }
.cont { font-size: 11.5px; color: var(--muted); font-style: italic; margin: 1px 0; }
.src-extra { margin: 18px 0 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; background: var(--panel); }
.src-extra summary { cursor: pointer; color: var(--muted); }
.src-extra blockquote { font-family: var(--ml); font-size: 14.5px; margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--line); }

/* ── Book layout view (source.html) ── */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #ece8e1; margin-right: 4px; flex: none; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.seg-btn svg { width: 16px; height: 16px; }
.seg-btn:hover:not(.on) { color: var(--ink); filter: none; }
.seg-btn.on { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.book-hint { font-size: 13px; }
/* the book's own ornamental border, taken from the scanned page (corners
   + one unit of each edge, repeated to fit — book-border.png, 97px band) */
.book-view { --book-pink: #f7027f;    /* the book's one pink: border, title, Juz' label, page number */
  font-family: var(--ml); font-size: 15.5px; line-height: 1.9; color: #1f1d1b; background: #fffdfa;
  border: 21px solid var(--book-pink); border-image: url("/static/book-border.png") 97 round;
  padding: 18px 24px; text-align: justify; }
.book-view p { margin: 0 0 12px; cursor: text; }
.book-view p:hover { background: var(--edit-soft); border-radius: 3px; }
.book-view h1 { font-size: 22px; text-align: center; margin: 4px 0 8px; color: var(--book-pink); }
.book-view h2 { font-size: 18px; text-align: center; color: var(--book-pink); margin: 10px 0; }
.book-view p[align="center"]:has(+ h1) b { color: var(--book-pink); font-family: "Amiri", serif; font-size: 1.3em; }
.book-view p[align="center"] { text-align: center; }
.book-view table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.book-view td { vertical-align: top; padding: 6px 8px; font-weight: 600; text-align: left; }
.book-view td[dir="rtl"] { font-family: "Amiri", serif; font-weight: 400; font-size: 23px; line-height: 2.1; text-align: right; }
.book-view hr { border: 0; border-top: 1px solid #555; margin: 8px 0; }
.book-view p[dir="ltr"] { font-size: 14px; line-height: 2; }
.book-view hr[width] { width: 30%; margin-left: 0; border-top-color: #999; }
.book-view sub { font-size: 13px; vertical-align: baseline; color: #444; }
.book-view p[align="center"] > sub { font-weight: 700; color: var(--book-pink); }

/* ── differences from the book (Malayalam text check) ─────────────────── */
:root {
  --df: #b42318;            /* the text's words */
  --df-bg: #fde4e1;
  --df-book: #136c3a;       /* what the book has */
  --df-book-bg: #dcf3e4;
}
mark.df { background: var(--df-bg); color: var(--df); border-radius: 3px; padding: 0 2px;
  text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .45); text-decoration-thickness: 1.5px; }
mark.df-extra { text-decoration-style: double; }
.df-book { background: var(--df-book-bg); color: var(--df-book); border-radius: 3px; padding: 0 5px; margin: 0 2px;
  font-weight: 600; white-space: normal; cursor: pointer; }
.df-book::before { content: "📖\00a0"; font-size: .78em; font-weight: 400; }
.df-ins { color: var(--df); font-weight: 700; }
sup.df-n, .df-badge, .df-chip, .dbox-n {
  background: var(--df); color: #fff; font: 700 10.5px/16px system-ui, sans-serif; border-radius: 8px;
  min-width: 16px; padding: 0 4px; text-align: center; display: inline-block; }
sup.df-n { vertical-align: super; margin-left: 1px; cursor: pointer; }
.df-badge { border: 0; margin-right: 6px; cursor: pointer; height: 18px; min-width: 18px; line-height: 18px; }
.src-flag.diff { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; background: #fff7f6; border-color: #f5c6c0; }
.src-flag.diff .df-msg { flex: 1 1 260px; }
.src-flag.diff .q { font-family: var(--serif); font-size: 15px; padding: 0 3px; border-radius: 3px; }
.src-flag.diff .q.book { background: var(--df-book-bg); color: var(--df-book); font-weight: 600; }
.src-flag.diff .q.text { background: var(--df-bg); color: var(--df); }
.src-flag.diff .df-actions { display: inline-flex; gap: 8px; align-items: center; }
.src-removed { color: var(--muted); font-style: italic; padding: 4px 0; }
.diffbar { background: #fff7f6; border: 1px solid #f5c6c0; border-radius: 8px; padding: 9px 12px; margin: 0 0 12px;
  font-size: 13.5px; line-height: 1.9; }
.diffbar .df-chip { border: 0; margin: 0 3px; cursor: pointer; height: 20px; min-width: 20px; line-height: 20px; font-size: 11.5px; }
/* boxes on the book page */
.page-img { position: relative; margin: 0 auto 12px; }
.images .page-img img { width: 100%; margin: 0; }
.dbox-layer { position: absolute; inset: 0; pointer-events: none; }
.dbox { position: absolute; border: 2px solid var(--df); background: rgba(180, 35, 24, .10); border-radius: 3px;
  pointer-events: auto; cursor: pointer; }
.dbox.near { border-style: dashed; background: transparent; }
.dbox-missing { border-color: var(--df-book); background: rgba(19, 108, 58, .10); }
.dbox-missing .dbox-n { background: var(--df-book); }
.dbox-n { position: absolute; left: -9px; top: -11px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
/* linked: hovering one shows the other; a jump makes both blink */
.dbox.hl, mark.df.hl, .df-ins.hl, .df-book.hl, .df-chip.hl { outline: 3px solid #f2c94c; outline-offset: 1px; }
.dbox.flash, mark.df.flash, .df-ins.flash, .book-view .flash { animation: df-flash 1.6s ease-out; }
@keyframes df-flash { 0%, 40% { box-shadow: 0 0 0 6px rgba(242, 201, 76, .9); } 100% { box-shadow: 0 0 0 0 rgba(242, 201, 76, 0); } }
.book-view mark.df { cursor: pointer; }
.book-view .df-ins { cursor: pointer; }
mark.df.else { background: transparent; color: inherit; text-decoration-color: rgba(180, 35, 24, .6);
  text-decoration-style: wavy; }
.src-flag.diff.else { background: transparent; border-style: dashed; }
/* the English page in the book layout */
.book-view.en { font-family: var(--serif); font-size: 16px; line-height: 1.75; }
.book-view.en table { border-collapse: separate; border-spacing: 0 8px; }
.book-view.en td { font-weight: 600; line-height: 1.6; }
.book-view.en td:not([dir="rtl"]) {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}
.book-view.en p[dir="ltr"] { font-size: 14.5px; line-height: 2.1; }
.book-view.en td:not([dir]):hover, .book-view.en p[dir="ltr"]:hover { background: var(--edit-soft); cursor: text; }
.book-view.en p[dir="ltr"] span[dir="rtl"] { font-family: "Amiri", serif; font-size: 1.3em; line-height: 1; }

/* ── home link and who is reviewing (sign-in switched off) ───────────── */
a.brand { text-decoration: none; }
.who.changeable { cursor: pointer; border-bottom: 1px dashed currentColor; }
.who.changeable:hover { color: var(--accent); }
.rv-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(7, 42, 38, .5); backdrop-filter: blur(2px); }
.rv-modal { position: relative; width: min(420px, 100%); padding: 30px 26px 22px; border-radius: 18px;
  background: #fffdf8; border: 1px solid #e7dfca; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); text-align: center; }
.rv-modal h2 { font-family: var(--serif); font-size: 26px; margin: 2px 0 6px; color: #0b3b36; }
.rv-modal p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.rv-modal input { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid #d9cfb2; background: #fff; }
.rv-modal input:focus { outline: 2px solid #c9a24a; border-color: #c9a24a; }
.rv-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.rv-actions button { font: inherit; font-weight: 600; padding: 8px 15px; border-radius: 10px; cursor: pointer; }
.rv-actions .rv-skip { background: #fff; color: var(--ink); border: 1px solid #e7dfca; }
.rv-actions .rv-ok { background: #0b3b36; color: #fbf7ee; border: 1px solid #0b3b36; }


/* the top bar in narrower windows: fewer words, same buttons */
@media (max-width: 1599px) { .brand span { display: none; } .dirty-note { display: none !important; } }   /* (the filled “Save (n)” says it too) */
@media (max-width: 1280px) { .pager .pill-select { width: 220px; } .mini-bar { display: none; } }
@media (max-width: 1100px) { .brand b { display: none; } .chip-toggle { padding: 0 11px; } }

/* ── phones and narrow windows (see the note at the old breakpoint) ───── */
@media (max-width: 900px) {
  body { height: 100vh; height: 100dvh; overflow: hidden; }   /* (dvh: Safari's visible height) */
  .pane-bar {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pane-bar::-webkit-scrollbar { display: none; }
  /* the top bar: the surah, the pages and your account (Download and Help are in its menu) */
  .topbar { flex-wrap: nowrap; gap: 6px; padding: 6px 10px; min-height: 50px; }
  .pane-bar > * { flex: none; }
  .topbar .spacer, .pane-bar .spacer { flex: 0 0 2px; }
  .topbar .spacer { display: none; }
  .progress, .chip-toggle, .brand, .bar-tools { display: none; }
  #surahSelect, #sourceSelect { flex: 0 1 auto; min-width: 0; max-width: 31vw; padding: 0 24px 0 11px; background-position: right 8px center; }
  .pager { flex: 1 1 auto; min-width: 0; }
  .pager .pill-select { flex: 1 1 auto; width: auto; min-width: 0; padding: 0 24px 0 11px; background-position: right 8px center; }
  .topbar .acct-menu { margin-left: auto; }
  .acct-menu .menu { position: fixed; right: 8px; top: 58px; max-width: calc(100vw - 16px); }
  .pane-bar { gap: 6px; padding: 5px 8px; min-height: 40px; }
  .panes { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--vsplit, 40%) 16px minmax(0, 1fr); }
  .divider { display: block; cursor: row-resize; touch-action: none; position: relative; }
  .divider::after {                    /* the grip */
    content: ""; position: absolute; left: 50%; top: 50%; width: 48px; height: 5px;
    margin: -2.5px 0 0 -24px; border-radius: 3px; background: var(--muted); opacity: .55;
  }
  .scroll { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .images { padding: 6px; }
}
@media (max-width: 900px) {
  /* the text's own bar: every button in view (two rows if needed) */
  .pane.right .pane-bar { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  .pane.right .pane-bar button { padding: 5px 10px; }
}

/* ── moving footnotes (Malayalam text check) ─────────────────────────── */
.move-btn { padding: 2px 9px; font-size: 13px; background: var(--panel); color: var(--accent); border: 1px solid var(--accent-soft); }
.move-btn:hover { background: var(--accent-soft); }
.mv-modal h3 { margin: 0 0 4px; font-size: 18px; }
.mv-text { font-family: var(--ml); font-size: 16px; line-height: 1.9; max-height: 34vh; overflow: auto; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; user-select: text; -webkit-user-select: text; cursor: text; }
.mv-text::selection, .mv-text *::selection { background: #ffe08a; }
.mv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 0 8px; font-size: 13px; }
.mv-picked { flex: 1; }
@media (max-width: 900px) { .modal-row { grid-template-columns: 1fr; gap: 4px; } }

/* English review: moving or removing word meanings */
.wm-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: 12px; }
.wm-btn { padding: 2px 10px; font-size: 12.5px; background: var(--panel); color: var(--accent); border: 1px solid var(--accent-soft); }
.wm-btn:hover { background: var(--accent-soft); }
.verse.added { margin: 6px 0 10px; }
.wm-modal { width: min(680px, 96vw); max-height: 92dvh; display: flex; flex-direction: column; }
.modal-help { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.wm-quick { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.wm-quick button.link { font-size: 12.5px; }
.wm-picks { overflow: auto; max-height: 42dvh; border: 1px solid var(--line, #e6dfd8); border-radius: 8px; padding: 4px 0; margin-bottom: 6px; }
.wm-pick { display: flex; align-items: baseline; gap: 8px; padding: 4px 10px; cursor: pointer; line-height: 1.5; }
.wm-pick:hover { background: var(--bg); }
.wm-pick:has(input:checked) { background: var(--accent-soft); }
.wm-pick input { flex: none; align-self: center; }
.wm-pick .n { flex: none; width: 1.6em; text-align: right; color: var(--muted); font-size: 12px; }
.wm-pick .ar { font-family: "Amiri", serif; font-size: 17px; unicode-bidi: isolate; }
.wm-pick .dash { color: var(--muted); }
.wm-pick .en { font-family: var(--serif); font-size: 14.5px; }
.wm-pick .rep-tag { margin-left: auto; flex: none; font-size: 11.5px; color: #8a3000; background: var(--high-bg); border-radius: 8px; padding: 0 7px; }
button.danger { background: #b3261e; }
@media (max-width: 900px) {
  .wm-pick { flex-wrap: wrap; }
  .wm-pick .rep-tag { margin-left: 0; }
  .wm-modal .modal-actions { flex-wrap: wrap; }
}

/* English review: the AI check's notes boxed on the Malayalam page */
.nbox-layer { position: absolute; inset: 0; pointer-events: none; }
.nbox { position: absolute; border: 2px solid var(--high); background: rgba(230, 81, 0, .10); border-radius: 3px;
  pointer-events: auto; cursor: pointer; }
.nbox.MEDIUM { border-color: var(--med); background: rgba(245, 159, 0, .13); }
.nbox.approx { border-style: dashed; background: transparent; }
.nbox-n, .nbox-badge { background: var(--high); color: #fff; font: 700 10.5px/16px system-ui, sans-serif; border-radius: 8px;
  min-width: 16px; padding: 0 4px; text-align: center; display: inline-block; }
.nbox.MEDIUM .nbox-n, .nbox-badge.MEDIUM { background: var(--med); }
.nbox-n { position: absolute; left: -9px; top: -11px; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.nbox-badge { border: 0; margin-right: 6px; cursor: pointer; height: 18px; min-width: 18px; line-height: 18px; vertical-align: 1px; }
.nbox.hl, .issue.hl { outline: 3px solid #f2c94c; outline-offset: 1px; }
.nbox.flash { animation: df-flash 1.6s ease-out; }

/* English review: a verse's word meanings split across pages */
.wm-already { color: #8a3000; background: var(--high-bg); border-radius: 6px; padding: 4px 8px; font-size: 13px; margin-top: 6px; }
.wm-already:empty { display: none; }
.split-modal { width: min(820px, 96vw); max-height: 94dvh; display: flex; flex-direction: column; }
.split-imgs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px; flex: none; }
.split-img { flex: none; text-align: center; color: var(--muted); font-size: 12px; text-decoration: none; }
.split-img img { display: block; height: 210px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.split-list { overflow: auto; flex: 1 1 auto; min-height: 120px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; }
.split-page { position: sticky; top: -4px; background: var(--bg); padding: 5px 10px; font-size: 13px; border-bottom: 1px solid var(--line); z-index: 1; }
.split-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 10px; line-height: 1.5; }
.split-row.changed { background: var(--accent-soft); }
.split-row .n { flex: none; width: 1.6em; text-align: right; color: var(--muted); font-size: 12px; }
.split-row .ar { font-family: "Amiri", serif; font-size: 17px; unicode-bidi: isolate; }
.split-row .dash { color: var(--muted); }
.split-row .en { font-family: var(--serif); font-size: 14.5px; flex: 1 1 auto; }
.split-row select { flex: none; margin-left: auto; font-size: 13px; }
.split-rep { color: var(--muted); }
@media (max-width: 900px) {
  .split-img img { height: 150px; }
  .split-row { flex-wrap: wrap; }
}

/* English review version 2: arrange first, then edit */
.step-banner { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 14px; }
.step-banner.arrange { background: #eef4ff; border: 1px solid #c9d8f2; }
.step-banner.edit { background: var(--ok-soft, #e7f4ec); border: 1px solid #bfe0cb; }
.step-banner .step-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.step-banner p { margin: 2px 0 8px; color: #33415c; }
.step-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-progress { font-weight: 600; }
.fit-note { margin-bottom: 12px; }
.verse.cont { border-left: 3px solid var(--line); padding-left: 10px; }
.mv-join { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 6px 0 2px; }
