/* ── תרגול (practice) page styles — tirgul.html and any future
   per-technique pages ── */

.sidebar { width: 240px; letter-spacing: 0.15em; }

/* Breadcrumb button — dimmer, smaller, acts as "back" */
.nav-breadcrumb {
  color: #ccc !important;
  font-size: 0.88rem !important;
  font-weight: 400 !important;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-breadcrumb:hover {
  color: #555 !important;
  background: none !important;
}
.breadcrumb-arrow {
  font-size: 0.8rem;
}

.nav-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bbb;
  padding: 0.55rem 0.75rem 0.15rem;
  margin-top: 0.25rem;
}

.nav button {
  font-size: 1.05rem;
  letter-spacing: 0.1em;
}
.nav button:hover,
.nav button.active { letter-spacing: 0.1em; }

.page-title {
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  letter-spacing: 0.1em;
}

.page-subtitle {
  font-size: 1rem;
  color: #999;
  margin-bottom: 2.5rem;
  letter-spacing: 0.1em;
}

/* ── Top-level mode tabs (מבוא / שאלות) ── */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1.5rem;
}

.mode-tab {
  font-family: inherit;
  font-size: 1.05rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0.6rem 0.2rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.05em;
  transition: color 0.1s, border-color 0.1s;
}

.mode-tab:hover { color: #555; }

.mode-tab.active {
  color: #1a1a1a;
  font-weight: 700;
  border-bottom-color: #1a1a1a;
}

/* ── Intro placeholders ── */
.media-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f4f4f2;
  border: 1px dashed #ccc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.text-placeholder {
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.8;
  border: 1px dashed #eee;
  border-radius: 4px;
  padding: 1.5rem;
  text-align: center;
}

/* ── Sub-genre tabs (e.g. יחס הפוך / יחס ישר) ── */
.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.topic-tabs:empty { display: none; margin-bottom: 0; }

.topic-tab {
  font-family: inherit;
  font-size: 0.9rem;
  background: none;
  border: 1px solid #ddd;
  border-radius: 999px;
  color: #555;
  padding: 0.35rem 1rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.topic-tab:hover { border-color: #999; }

.topic-tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  font-weight: 700;
}




/* ── Question block ── */
.question {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  align-items: start;
  padding: 1.5rem 0 1.5rem 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  position: relative;
}
.question > * { grid-column: 2; }
.question:first-of-type { border-top: none; padding-top: 0; }

.q-num {
  grid-column: 1;
  position: static;
  right: auto;
  top: auto;
  font-weight: 700;
  font-size: 1rem;
  font-family: 'David Libre', serif;
  line-height: 1.8;
}

.question.q-answered::after {
  content: '✓ פתרת';
  position: absolute;
  left: 0;
  bottom: 0.6rem;
  font-size: 0.78rem;
  font-family: 'Google Sans', Arial, sans-serif;
  color: #bbb;
  line-height: 1;
  white-space: nowrap;
  background: #fff;
  padding-right: 0.35rem;
}

/* Shinun done badge */
.q-done-badge {
  font-size: 0.75rem;
  color: #bbb;
  margin-right: 0.4rem;
}

.q-text {
  direction: rtl;
  text-align: right;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  line-height: 1.8;
  unicode-bidi: plaintext;
  letter-spacing: 0.04em;
  font-family: 'David Libre', serif;
  white-space: pre-line;
}

/* Extra breathing room around inline MathJax in mixed Hebrew/math sentences */
mjx-container[jax="CHTML"][display="false"] {
  margin-inline-start: 0.22em;
  margin-inline-end: 0.14em;
}
/* MathJax followed by ? — extra gap inserted via .qm-gap span (formatMath moves the ? here) */
.qm-gap { margin-inline-start: 0.4em; }

.q-title {
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.6rem;
  direction: rtl;
  text-align: right;
}

.q-passage {
  direction: rtl;
  text-align: right;
  font-family: 'David Libre', serif;
  font-size: 1.05rem;
  line-height: 2;
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
  unicode-bidi: plaintext;
}

.choices {
  display: table;
  width: auto;
  border-collapse: separate;
  border-spacing: 0 0.45rem;
  direction: rtl;
  letter-spacing: 0.04em;
  font-family: 'David Libre', serif;
  margin-right: 0;
  margin-left: auto;
}

.choice-row { display: table-row; cursor: pointer; }

.choice-mark {
  display: table-cell;
  width: 1rem;
  padding-left: 0.5rem;
  vertical-align: top;
  text-align: center;
  font-size: 0.85rem;
}

.choice-label {
  display: table-cell;
  white-space: nowrap;
  padding-left: 0.7rem;
  vertical-align: top;
  direction: ltr;
  text-align: right;
  width: 2.2rem;
  font-size: 1.05rem;
}

.choice-text {
  display: table-cell;
  direction: rtl;
  text-align: right;
  vertical-align: top;
  font-size: 1.05rem;
}

.choice-row:hover .choice-label,
.choice-row:hover .choice-text { opacity: 0.55; }

.choice-row.disabled { cursor: default; }
.choice-row.disabled:hover .choice-label,
.choice-row.disabled:hover .choice-text { opacity: 1; }

.choice-row.correct .choice-label,
.choice-row.correct .choice-mark,
.choice-row.correct .choice-text { font-weight: 700; }
.choice-row.correct .choice-mark::after { content: '✓'; }

.choice-row.wrong .choice-label,
.choice-row.wrong .choice-text {
  color: #999;
  text-decoration: line-through;
}

.choices.inline {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 0 2.6rem;
  flex-wrap: nowrap;
  margin-top: 0.8rem;
}
.choices.inline .choice-row {
  display: flex;
  flex-direction: row;
  gap: 0 0.4rem;
  align-items: baseline;
}
.choices.inline .choice-mark { display: inline; width: auto; padding-left: 0; }
.choices.inline .choice-label { display: inline; width: auto; padding-left: 0; }
.choices.inline .choice-text { display: inline; width: auto; }

/* ── Stacked math fractions (e.g. 3/4) ── */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 0.15em;
  font-size: 0.85em;
  line-height: 1.15;
  text-align: center;
}
.frac-num {
  padding: 0 0.2em 0.1em;
  border-bottom: 1px solid currentColor;
}
.frac-den {
  padding: 0.1em 0.2em 0;
}

/* ── Keep equations from breaking mid-expression, and force LTR
   rendering regardless of the surrounding RTL text ── */
.eq {
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: embed;
}

/* ── Solutions ── */
.post-answer { display: none; margin-top: 1.1rem; }

.reveal-btn {
  font-family: inherit;
  font-size: 0.84rem;
  background: none;
  border: 1px solid #888;
  color: #555;
  padding: 0.22rem 0.9rem;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.1s, color 0.1s;
}
.reveal-btn:hover { background: #444; color: #fff; border-color: #444; }

.solution-panel { display: none; margin-top: 0.85rem; border: 1px solid #ccc; overflow: hidden; }
.solution-panel.visible { display: block; }

.sol-tabs {
  display: flex;
  flex-direction: row-reverse;
  border-bottom: 1px solid #ccc;
  background: #f4f4f2;
}
.sol-tab {
  flex: 1;
  padding: 0.3rem 0.4rem;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #777;
  transition: background 0.1s, color 0.1s;
  border-right: 1px solid #ccc;
}
.sol-tab:last-child { border-right: none; }
.sol-tab.active { background: #fff; color: #000; font-weight: 600; }



.sol-body {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  direction: rtl;
  display: none;
  background: #fafaf8;
  line-height: 1.75;
  white-space: pre-line;
}
.sol-body.active { display: block; }
.sol-body p { margin: 0 0 0.5rem; }
.sol-body p:last-child { margin-bottom: 0; }

/* Single-explanation toggle (verbal / passage questions) */
.sol-toggle-single {
  margin-top: 0.9rem;
  padding: 0.28rem 0.9rem;
  background: none;
  border: 1px solid #bbb;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  color: #555;
}
.sol-toggle-single:hover { background: #f5f5f3; }
.sol-explanation { border-top: 1px solid #e2e2de; margin-top: 0.4rem; }

/* Passage cluster: title + reading-passage block (matches shiurim style) */
.q-passage-title {
  font-family: 'David Libre', serif;
  font-size: 1.05rem;
  font-weight: 700;
  direction: rtl;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.reading-passage {
  direction: rtl;
  font-family: 'David Libre', serif;
  font-size: 0.93rem;
  line-height: 1.8;
  margin: 0 0 1.4rem;
  border: 1px solid #d8d8d4;
  border-radius: 6px;
  padding: 1rem 1.2rem 1rem 0.6rem;
  background: #fff;
}
.rp-block {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.rp-text {
  flex: 1;
  direction: rtl;
  min-width: 0;
}
.rp-para-break {
  display: block;
  height: 0.45rem;
}
.rp-ln {
  flex-shrink: 0;
  width: 2.3rem;
  font-size: 0.78em;
  color: #999;
  text-align: right;
  padding-top: 0.12em;
  font-weight: 400;
  letter-spacing: -0.02em;
  order: -1;
}

.choices-analysis { margin-top: 0.75rem; }
.choices-analysis p { margin: 0.3rem 0; line-height: 1.5; }

/* ── Direct-ratio "arrow" diagram (solutions.<key>_layout) ── */
.ratio-layout {
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #e2e2de;
}
.rl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(4rem, 8rem));
  justify-content: center;
  text-align: center;
  gap: 0.2rem 1.6rem;
  margin: 0 auto;
}
.rl-grid-h {
  display: grid;
  grid-template-columns: minmax(3rem, 6rem) auto minmax(3rem, 6rem);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.3rem 1rem;
  margin: 0 auto;
}
.rl-head {
  font-weight: 700;
  font-size: 0.85rem;
  color: #555;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ccc;
}
.rl-cell { font-size: 1.05rem; padding: 0.3rem 0; }
.rl-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  color: #999;
}
.rl-arrow-ico { font-size: 1.1rem; line-height: 1; }
.rl-mult { font-size: 0.7rem; }
.rl-tabs {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.rl-tab {
  font-family: inherit;
  font-size: 0.75rem;
  background: none;
  border: 1px solid #ddd;
  border-radius: 999px;
  color: #999;
  padding: 0.15rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}
.rl-tab:hover { border-color: #999; }
.rl-tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  font-weight: 600;
}
.rl-view { display: none; }
.rl-view.active { display: block; }
.rl-solution {
  text-align: center;
  margin-top: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ── Empty state ── */
.empty-state {
  padding: 3rem 0;
  color: #aaa;
  font-size: 1rem;
  text-align: center;
  border-top: 1px solid #f0f0ee;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 0 0.5rem;
}

.page-btn {
  font-family: inherit;
  font-size: 0.9rem;
  background: none;
  border: 1px solid #ddd;
  color: #555;
  min-width: 2.2rem;
  height: auto;
  padding: 0.22rem 0.5rem;
  line-height: 1.3;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.page-btn:hover:not(:disabled) { border-color: #999; }

.page-btn.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  font-weight: 700;
}

.page-btn.arrow { height: 3.2rem; }
.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.page-btn.dimmed {
  color: #bbb;
  border-color: #e8e8e8;
  background: #fafafa;
  cursor: default;
  opacity: 1;
}

/* Quota exhausted — unanswered questions on the page fade and become unclickable */
.quota-faded {
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.4);
  transition: opacity 0.4s ease;
}

.locked-page-wrap {
  position: relative;
  max-height: 420px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.locked-page-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, #fff 100%);
}

.locked-page-msg {
  text-align: center;
  color: #1a1a1a;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 1.2rem 0 2rem;
}
.locked-goto-open {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.45rem 1.2rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.locked-goto-open:hover { background: #333; }

/* ── Planning question (תכנון והעלאת טיעונים) ── */
.plan-task-box {
  border: 1.5px solid #1a1a1a;
  border-radius: 2px;
  padding: 1.4rem 1.6rem;
  direction: rtl;
  font-family: 'David Libre', serif;
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 2rem;
}
.plan-task-box p + p { margin-top: 1rem; }

.plan-question + .pagination,
.plan-question ~ .pagination { margin-top: 1.5rem; }
.plan-task-question { font-weight: 700; }

/* ── Hebrew essay (writing_full) Robodek integration ──────────────────────── */
.plan-essay-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  font-family: 'David Libre', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  direction: rtl;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  min-height: 200px;
  background: var(--bg, #fff);
  color: var(--text, #1a1a1a);
}
.plan-essay-textarea:focus { outline: none; border-color: #1a1a1a; }

.plan-essay-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  direction: rtl;
}
.plan-essay-wc { font-size: 0.82rem; color: #888; }

.plan-essay-submit {
  padding: 0.45rem 1.2rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
}
.plan-essay-submit:hover { background: #333; }
.plan-essay-submit:disabled { opacity: 0.6; cursor: default; }

.plan-essay-result { margin-top: 1.25rem; }

.per-result-wrap { direction: rtl; }
.per-avg { font-size: 1rem; margin-bottom: 0.9rem; }
.per-scores { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; }
.per-score-row { display: flex; align-items: center; gap: 0.5rem; }
.per-score-label { flex: 0 0 11rem; font-size: 0.8rem; color: #444; }
.per-score-bar-wrap { flex: 1; height: 8px; background: #e5e5e5; border-radius: 4px; overflow: hidden; }
.per-score-bar { height: 100%; background: #1a1a1a; border-radius: 4px; transition: width 0.4s; }
.per-score-num { flex: 0 0 2.2rem; font-size: 0.8rem; text-align: start; }

.per-summary, .per-improve { font-size: 0.88rem; line-height: 1.6; margin-bottom: 0.5rem; }
.per-feedback { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.7rem; }
.per-fb-item { border-top: 1px solid #e5e5e5; padding-top: 0.6rem; }
.per-fb-header { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.25rem; }
.per-fb-quote { font-size: 0.82rem; color: #666; border-inline-start: 3px solid #ccc; padding-inline-start: 0.5rem; margin: 0.25rem 0; }
.per-fb-comment { font-size: 0.82rem; color: #444; margin: 0; }

.plan-instruction {
  font-size: 0.95rem;
  color: #555;
  direction: rtl;
  margin-bottom: 1.4rem;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
  direction: rtl;
}
.plan-table th {
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid #1a1a1a;
  width: 50%;
}
.plan-table td {
  text-align: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  height: 5rem;
}
.plan-hint-btn {
  font-family: inherit;
  font-size: 0.82rem;
  background: none;
  border: 1px solid #ccc;
  color: #888;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
}
.plan-hint-btn:hover { border-color: #888; color: #444; }

.plan-hint-text {
  font-size: 0.9rem;
  color: #444;
  direction: rtl;
  line-height: 1.5;
}
.plan-hint-text[hidden] { display: none; }

/* ── Opening question ── */
.open-table td {
  font-size: 0.92rem;
  color: #333;
  height: auto;
  padding: 0.55rem 1rem;
}

.open-suggestions-wrap {
  margin-top: 2rem;
}

.open-suggestions-btn {
  font-family: inherit;
  font-size: 0.88rem;
  background: none;
  border: 1px solid #999;
  color: #444;
  padding: 0.25rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.open-suggestions-btn:hover { background: #444; color: #fff; }

.open-suggestions[hidden] { display: none; }

.open-suggestions {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.open-suggestion {
  border-right: 3px solid #e0e0de;
  padding-right: 1rem;
  direction: rtl;
}

.open-suggestion-label {
  font-size: 0.78rem;
  color: #aaa;
  display: block;
  margin-bottom: 0.3rem;
  letter-spacing: 0.03em;
}

.open-suggestion p {
  font-size: 1rem;
  line-height: 1.85;
  color: #333;
}

/* ── Definition question ── */
.def-word {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'David Libre', serif;
  white-space: nowrap;
}

.def-body {
  font-size: 1.05rem;
  line-height: 2.2;
  direction: rtl;
  font-family: 'David Libre', serif;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.def-drop {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  background: #fff;
  color: #333;
  transition: border-color 0.1s, background 0.1s, color 0.1s;
}

.def-drop:has(option[value=""]:checked) {
  color: #bbb;
}

.def-body {
  padding-top: 1.4em;
}

.def-unit {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.def-feedback {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #999;
  white-space: nowrap;
  font-family: 'Google Sans', Arial, sans-serif;
  visibility: hidden;
  margin-bottom: 0.15rem;
}

.def-feedback:not(:empty) {
  visibility: visible;
}

.def-check {
  color: #16A34A;
  font-weight: 700;
  font-size: 1rem;
}

/* ── Sentence question (בניית משפט מגדיר יחס) ── */
.sent-pair {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  direction: rtl;
  font-family: 'David Libre', serif;
  margin-bottom: 0.2rem;
  letter-spacing: 0.04em;
}

.sent-body {
  padding-top: 1.4em;
}

.sent-text {
  white-space: pre;
}

.sent-conclusion {
  font-size: 0.88rem;
  color: #16A34A;
  direction: rtl;
  font-family: 'David Libre', serif;
  margin-top: 0.4rem;
  min-height: 1.2em;
}

/* ── Shinun summary styles ── */
.shinun-summary {
  padding: 0.5rem 0;
  line-height: 1.75;
}
.shinun-summary h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 1.4rem 0 0.5rem;
}
.shinun-summary h3:first-child { margin-top: 0; }

.shinun-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 1.4rem 0 0.5rem;
}

.shinun-summary .collapsible-arrow {
  font-size: 0.72rem;
  color: #bbb;
  font-weight: 400;
  margin-right: 0.6rem;
  display: inline-block;
}

.shinun-summary .collapsible-body {
  display: block;
}

.shinun-summary .collapsible-h3-closed {
  border-bottom: 1px solid #f0f0ee;
  padding-bottom: 0.6rem;
}
.shinun-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}
.shinun-list li {
  padding: 0.25rem 0;
  font-size: 1rem;
  color: #222;
  border-bottom: 1px solid #f0f0f0;
}
.shinun-list li:last-child { border-bottom: none; }
.shinun-box {
  background: #f5f5f5;
  border-right: 3px solid #1a1a1a;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  font-size: 1rem;
  margin: 0.4rem 0 0.8rem;
  font-family: 'Google Sans', Arial, sans-serif;
  direction: rtl;
}
.shinun-note {
  font-size: 0.88rem;
  color: #666;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 0.4rem 0.8rem;
  margin-top: 0.6rem;
}
.shinun-table-wrap { margin: 0.4rem 0 0.8rem; }
.shinun-table {
  border-collapse: collapse;
  font-size: 0.92rem;
  width: 100%;
}
.shinun-table th,
.shinun-table td {
  border: 1px solid #ddd;
  padding: 0.35rem 0.7rem;
  text-align: center;
}
.shinun-table th {
  background: #f5f5f5;
  font-weight: 700;
  color: #1a1a1a;
}

.shinun-fig {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0.7rem 0 1rem;
}

/* ── Shinun quiz styles ── */
.sq-wrap { max-width: 560px; }
.sq-question-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  direction: ltr;
}
.sq-question-row .sq-fig { flex-shrink: 0; }
.sq-question-row .sq-fig img,
.sq-question-row .sq-fig svg { max-width: 200px; height: auto; display: block; }
.sq-question-content { flex: 1; }
.sq-progress { font-size: 0.82rem; color: #aaa; margin-bottom: 0.9rem; letter-spacing: 0.03em; }
.sq-question {
  font-size: 1.05rem; font-weight: 600; color: #1a1a1a;
  margin-bottom: 1.1rem; line-height: 1.6;
  text-align: right;
}
.sq-choices { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 1rem; }
.sq-choice-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1px solid #f0f0ee;
  cursor: pointer;
  font-size: 0.93rem;
  color: #1a1a1a;
  transition: background 0.1s;
}
.sq-choice-row:first-child { border-top: 1px solid #f0f0ee; }
.sq-choice-row:hover { background: #fafafa; }
.sq-choice-label { color: #aaa; font-size: 0.82rem; min-width: 1.4rem; flex-shrink: 0; }
.sq-choice-text  { }
.sq-choice-row.sq-correct { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.sq-choice-row.sq-correct .sq-choice-label { color: #ccc; }
.sq-choice-row.sq-wrong   { color: #bbb; }
.sq-explanation {
  background: #f5f5f5; border-right: 3px solid #1a1a1a;
  padding: 0.65rem 1rem; border-radius: 4px;
  font-size: 0.9rem; color: #333; margin-bottom: 1rem; line-height: 1.55;
}
.sq-next {
  background: #1a1a1a; color: #fff; border: none; border-radius: 4px;
  padding: 0.6rem 1.8rem; font-family: inherit;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.sq-done { text-align: center; padding: 2.5rem 0; }
.sq-done-score { font-size: 2.8rem; font-weight: 700; color: #1a1a1a; margin-bottom: 0.4rem; }
.sq-done-msg   { font-size: 1.1rem; color: #555; margin-bottom: 1.5rem; }

/* ── Timed practice mode ── */
.timed-session { max-width: 680px; }

/* ── Shinun countdown timer ── */
.sq-timer-wrap { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.sq-timer-bar-track { flex: 1; height: 4px; background: #f0f0ee; border-radius: 2px; overflow: hidden; }
.sq-timer-bar-fill  { height: 100%; background: #1a1a1a; border-radius: 2px; transition: width 0.9s linear, background 0.3s; }
.sq-timer-val { font-size: 0.82rem; color: #aaa; min-width: 1.8rem; text-align: left; font-variant-numeric: tabular-nums; }
.timed-counter { font-size: 0.85rem; color: #aaa; margin-bottom: 0.75rem; }
.timed-timer-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.group-progress {
  font-size: 0.82rem; color: #888; text-align: right; margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.timed-timer-val {
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 1.15rem; font-weight: 400; letter-spacing: 0.20em;
  color: #1a1a1a; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.timed-counter {
  font-size: 0.85rem; color: #aaa;
  font-variant-numeric: tabular-nums;
}
#timedFeedback { margin-top: 0.75rem; font-weight: 600; font-size: 0.95rem; }
.timed-done { padding: 2rem 0; text-align: center; color: #333; }

.timed-next-btn {
  margin-top: 1.2rem;
  display: block;
  background: none;
  border: none;
  color: #1a1a1a;
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.timed-next-btn:hover { opacity: 1; }

/* Tirgul 3-panel quant sub-nav */
#navPanels.drilled-1 { transform: translateX(calc(100% / 3)); }
#navPanels.drilled-2 { transform: translateX(calc(100% / 3)); }

/* English (LTR) content */
.ltr-content .q-text,
.ltr-content .choice-text,
.ltr-content .post-answer p {
  direction: ltr;
  text-align: left;
}
.ltr-content .choices,
.ltr-content .choice-row,
.ltr-content .choice-label {
  direction: ltr;
  text-align: left;
}
.ltr-content .choice-label {
  padding-right: 0.6rem;
  padding-left: 0;
}
.ltr-content .reading-passage {
  direction: ltr;
  text-align: left;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.15rem;
  padding: 1rem 0.6rem 1rem 0.4rem;
}
.ltr-content .rp-text {
  direction: ltr;
  text-align: left;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.15rem;
}
/* RC / LTR: line numbers stay left; aligned with first text line */
.ltr-content .rp-ln {
  font-size: 0.9em;
  width: 3.5rem;
  padding-right: 1.2rem;
  line-height: 1;
  padding-top: 0.48rem;
  text-align: right;
}
/* RC / LTR: Hebrew explanations stay RTL */
.ltr-content .sol-explanation {
  direction: rtl;
  text-align: right;
}
.ltr-content .q-passage-title {
  direction: ltr;
  text-align: left;
}
/* SC / LTR: flip grid so q-num column is on the left */
.ltr-content .question { direction: ltr; }
.ltr-content .q-num { direction: ltr; }
/* SC / LTR: English text in Times New Roman */
.ltr-content .q-text,
.ltr-content .choice-text {
  font-family: 'Times New Roman', Times, serif;
}
/* SC / LTR: check mark on left of label */
.ltr-content .choice-mark {
  padding-left: 0;
  padding-right: 0.5rem;
}

/* Diagram inference chart wrapper */
.dgr-chart-wrap { margin-bottom: 2rem; }

/* ── Reading passage two-column layout ─────────────────────────────────────── */
.rp-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 0;
}
.rp-passage-col {
  flex: 3;
  min-width: 0;
}
.rp-side-col {
  flex: 2;
  min-width: 0;
  border-right: 1px solid #e0e0e0;
  padding-right: 1.25rem;
}
.rp-below-qs {
  margin-top: 0.5rem;
}

/* ── Paragraph single-question timer mode ──────────────────────────────────── */
.pq-hidden { display: none !important; }
.pq-active  { display: block; }
.pq-wrap .question { border-top: 1px solid #000; padding-top: 1.5rem; }

.pq-fixed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.pq-timer-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pq-timer-btn {
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 0.2rem 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s, border-color 0.2s;
}
.pq-timer-btn.pq-timer-idle { color: #555; border-color: #999; }
.pq-timer-btn.urgent { color: inherit; border-color: inherit; }
.pq-timer-val { font-variant-numeric: tabular-nums; }

.pq-pause-btn {
  background: none;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: #555;
  line-height: 1;
}
.pq-pause-btn:hover { border-color: #999; }

.pq-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0 0.3rem;
  margin-bottom: 0.8rem;
}
.pq-next-btn,
.pq-prev-btn {
  font-size: 0.78rem;
  color: #444;
  white-space: nowrap;
  padding: 0.22rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #f5f5f5;
  cursor: pointer;
  font-family: 'Google Sans', Arial, sans-serif;
}
.pq-next-btn { margin-inline-start: auto; }
.pq-next-btn:hover:not(:disabled),
.pq-prev-btn:hover { background: #eaeaea; color: #111; border-color: #ccc; }
.pq-next-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.pq-done-msg   { color: #888; font-size: 0.95rem; padding: 0.5rem 0; }
.pq-group-done { margin: 0 auto; font-size: 0.78rem; color: #222; font-family: 'Google Sans', Arial, sans-serif; }

/* ── Writing Task (Essay) ─────────────────────────────────────── */
.essay-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
  font-family: 'Google Sans', Arial, sans-serif;
  direction: ltr;
  text-align: left;
}

.essay-instructions {
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.9rem 1.1rem 0.7rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: #333;
}
.essay-inst-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.essay-instructions ul {
  margin: 0;
  padding-inline-start: 1.4rem;
  line-height: 1.8;
}

.essay-prompt-box {
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.essay-prompt-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #111;
}

.essay-timer-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.essay-timer-btn {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: 'Google Sans', Arial, sans-serif;
  color: #333;
}
.essay-timer-btn:hover { border-color: #555; }
.essay-timer-btn.essay-timer-urgent { color: #c0392b; border-color: #c0392b; }
.essay-timer-label {
  font-size: 0.82rem;
  color: #888;
}

.essay-textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: 'Google Sans', Arial, sans-serif;
  line-height: 1.7;
  resize: vertical;
  box-sizing: border-box;
  color: #111;
  background: #fff;
}
.essay-textarea:focus { outline: none; border-color: #1a1a1a; }

.essay-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
}
.essay-wordcount {
  font-size: 0.88rem;
  color: #888;
}
.essay-wc-ok  { color: #27ae60; font-weight: 600; }
.essay-wc-over { color: #c0392b; font-weight: 600; }

.essay-save-btn {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0.45rem 1.3rem;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: 'Google Sans', Arial, sans-serif;
}
.essay-save-btn:hover { background: #333; }
