/* ==========================================================================
   فهيم — My vocabulary (vocab.html): today's review, stats, word list,
   and the full-screen review session. Sketchbook look: yellow callout for
   what's due, white index cards, one pastel per row.
   ========================================================================== */
.v-today:empty { display: none; }

/* today's review */
.v-due { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; background: var(--highlight-soft); border: 1px solid var(--border-strong); border-radius: var(--r-panel); padding: 22px 26px; }
.v-due--done { background: var(--tint-violet); }
.v-due__n { width: 64px; height: 64px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 26px; font-weight: var(--w-display); }
.v-due__n .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.v-due__text h2 { font-size: 22px; line-height: 1.4; font-weight: var(--w-display); }
.v-due__text p { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.v-due .btn { min-height: 48px; padding-inline: 22px; }

.v-empty { display: grid; gap: 12px; justify-items: start; background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: var(--r-panel); padding: 26px; }
.v-empty h2 { font-size: 22px; font-weight: var(--w-display); }
.v-empty > p { color: var(--muted); }
.v-steps { display: grid; gap: 8px; counter-reset: s; width: 100%; margin: 4px 0 6px; }
.v-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 12px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); }
.v-steps li::before { counter-increment: s; content: counter(s); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--highlight); display: grid; place-items: center; font-size: 13px; font-weight: var(--w-display); }
.v-steps b { font-size: 14.5px; }
.v-steps span { font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* stats */
.v-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-24); }
.v-stats[hidden] { display: none; }
.v-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v-tile { display: grid; gap: 2px; align-content: center; padding: 16px 18px; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--border-strong); }
.v-tile b { font-size: 28px; font-weight: var(--w-display); line-height: 1.2; }
.v-tile span { font-size: 13px; color: var(--muted); }
.v-tile--hl { background: var(--tint-cyan); border-color: var(--ink); }
.v-forecast .card__head { margin-bottom: 12px; }
.v-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 130px; align-items: end; }
.v-bar { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; gap: 4px; justify-items: center; text-align: center; }
.v-bar b { font-size: 12px; min-height: 16px; }
.v-bar__fill { align-self: end; width: 100%; max-width: 36px; border-radius: 6px 6px 2px 2px; background: var(--tint-violet); border: 1px solid var(--border-strong); }
.v-bar:first-child .v-bar__fill { background: var(--highlight); }
.v-bar small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* word list */
#v-list-card[hidden] { display: none; }
.v-list { display: grid; }
.v-list > li { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) 96px 92px 34px; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1.5px dashed var(--border); }
.v-list > li:first-child { border-top: 0; }
.v-word { display: flex; align-items: center; gap: 6px; justify-content: flex-end; direction: ltr; }
.v-word b { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.v-meaning { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 14.5px; }
.v-missing { color: var(--faint); }
.v-example { flex-basis: 100%; font-size: 12.5px; line-height: 1.6; color: var(--muted); text-align: left; }
.v-example mark, .flip__example mark { background: var(--highlight); color: var(--ink); padding: 0 2px; border-radius: 2px; }
.v-status { justify-self: start; font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.v-status--new { background: var(--lilac); }
.v-status--learning { background: var(--tint-peach); border-color: #e2a27e; }
.v-status--mastered { background: var(--tint-violet); border-color: var(--ink); color: var(--ink); }
.v-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.v-when.is-due { color: var(--ink); font-weight: var(--w-semibold); }
.v-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; }
.v-icon:hover { background: var(--lilac); color: var(--ink); }
.v-icon .icon { width: 18px; height: 18px; }
.v-icon--del:hover { color: var(--terracotta); background: #fbe6dc; }
.v-none { padding: 20px 4px; color: var(--muted); font-size: 14px; display: block !important; }
.v-how { align-items: start; }

/* ---------- review session ---------- */
.review { width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 18px; border: 1px solid var(--border-strong); border-radius: var(--r-feature); background: var(--canvas); color: var(--ink); }
.review::backdrop { background: rgba(23, 25, 23, .55); }
.review__bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-bottom: 18px; }
.review__progress { height: 10px; border-radius: var(--r-pill); background: var(--lilac); overflow: hidden; border: 1px solid var(--border-strong); }
.review__progress span { display: block; height: 100%; width: 0; background: var(--highlight); border-inline-end: 1px solid var(--border-strong); }
.review__count { font-size: 13px; color: var(--muted); min-width: 52px; text-align: end; }
.review__stage[hidden], .review__done[hidden] { display: none; }

.flip {
  position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; cursor: pointer;
  min-height: 300px; align-content: center; padding: 34px 24px 26px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-panel);
  box-shadow: none;
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(23, 25, 23, .06) 31px 32px);   /* index-card lines */
}
.flip__status { position: absolute; top: 14px; inset-inline-start: 16px; font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: var(--r-pill); background: var(--canvas); border: 1px solid var(--border); }
.flip__word { font-family: var(--font-mono); font-size: clamp(30px, 6vw, 42px); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.flip__say { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.flip__say:hover { border-color: var(--ink); }
.flip__say[hidden] { display: none; }
.flip__example { max-width: 480px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.flip__example[hidden] { display: none; }
.flip__back { width: 100%; border-top: 1.5px dashed var(--border-strong); padding-top: 14px; margin-top: 6px; }
.flip__back[hidden] { display: none; }
.flip__meaning { font-size: 24px; font-weight: var(--w-display); color: var(--ink); line-height: 1.5; }

.review__actions { margin-top: 16px; }
.review__show { width: 100%; justify-content: center; min-height: 52px; font-size: 16px; }
.review__show[hidden] { display: none; }
kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: .6; margin-inline-start: 8px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grades[hidden] { display: none; }
.grade { display: grid; gap: 2px; justify-items: center; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; position: relative; top: 0; transition: top var(--dur-fast); }   /* lift with top: it holds Arabic text */
.grade:hover { top: -1px; }
.grade:disabled { opacity: .6; cursor: wait; }
.grade b { font-size: 15px; font-weight: var(--w-display); }
.grade small { font-size: 12px; color: var(--ink-2); }
.grade kbd { margin: 2px 0 0; }
.grade--again { background: #fbe6dc; border-color: var(--terracotta); }
.grade--hard { background: var(--tint-peach); }
.grade--good { background: var(--highlight); }
.grade--easy { background: var(--tint-violet); }

.review__done { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 30px 10px 10px; }
.review__done h2 { font-size: 24px; font-weight: var(--w-display); }
.review__done p { color: var(--muted); max-width: 420px; line-height: 1.8; }
.v-badge { width: 64px; height: 64px; border-radius: 16px; background: var(--highlight); border: 1px solid var(--border-strong); display: grid; place-items: center; }
.v-badge .icon { width: 30px; height: 30px; stroke-width: 2.2; }

/* ---------- responsive ---------- */
@media (max-width: 960px) { .v-stats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .v-due { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .v-due .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .v-due .v-today__acts { grid-column: 1 / -1; }
  .v-due__text h2 { font-size: 18px; }
  .v-list > li { grid-template-columns: minmax(0, 1fr) auto 34px; gap: 6px 10px; }
  .v-word { justify-content: flex-start; direction: ltr; grid-column: 1; }
  .v-meaning { grid-column: 1 / -1; grid-row: 2; }
  .v-status { grid-column: 2; grid-row: 1; }
  .v-when { grid-column: 1 / -1; grid-row: 3; font-size: 12px; }
  .v-icon--del { grid-column: 3; grid-row: 1; }
  .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flip { min-height: 260px; }
}
@media (hover: none) { kbd { display: none; } }

/* ---------- IELTS word bank ---------- */
.wb .card__head { margin-bottom: 10px; }
.wb .filters { margin-bottom: 16px; }
.wb-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
/* topic sticky notes. Hover = the note lifts (top, never transform: it holds Arabic text), its ink shadow
   grows, an arrow badge slides into the corner and the
   progress bar gets moving stripes. Only the text-free shapes move. */
.wb-topic {
  position: relative; top: 0; overflow: hidden;
  display: grid; gap: 4px; justify-items: start; text-align: start; padding: 14px 16px 16px;
  border-radius: var(--r-panel); border: 1px solid var(--border-strong); background: var(--tint); color: var(--ink);
  font: inherit; cursor: pointer; box-shadow: none;
  transition: top var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.wb-topic:hover, .wb-topic:focus-visible { top: -4px; box-shadow: none; }
.wb-topic:active { top: -1px; box-shadow: none; transition-duration: 80ms; }
.wb-topic:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wb-topic b { font-size: 16px; font-weight: var(--w-display); line-height: 1.4; }
.wb-topic::after {                                      /* arrow badge in the corner */
  content: "←"; position: absolute; top: 12px; left: -36px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--highlight);
  font-family: system-ui, sans-serif; font-size: 15px; line-height: 1;
  transition: left var(--dur) var(--ease-spring);
}
.wb-topic:hover::after, .wb-topic:focus-visible::after { left: 12px; }
.wb-bar > i { display: block; height: 100%; background: var(--ink); }
.wb-topic .wb-bar { transition: background-color var(--dur) var(--ease-out); }
.wb-topic:hover .wb-bar, .wb-topic:focus-visible .wb-bar {
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .85) 0 5px, rgba(23, 25, 23, .14) 5px 10px);
  background-size: 28px 28px; animation: wb-stripes .9s linear infinite;
}
@keyframes wb-stripes { to { background-position: 28px 0; } }
.wb-topic span { font-size: 12px; color: var(--ink-2); font-family: var(--font-mono); }
.wb-topic small { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.wb-bar { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .7); border: 1px solid rgba(23, 25, 23, .25); overflow: hidden; }
.wb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--border); }
.wb-head__t { flex: 1 1 220px; }
.wb-head h3 { font-size: 20px; font-weight: var(--w-display); }
.wb-head p { font-size: 13px; color: var(--muted); }
.wb-note { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.wb-words > li { grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr) 112px; }
.wb-pos { font-style: normal; font-size: 11.5px; color: var(--muted); }
.wb-have { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.wb-add { justify-self: start; }
.ln-card { cursor: default; }
.ln-card .flip__meaning { font-size: 22px; font-weight: var(--w-display); }
.ln-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ln-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.ln-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 720px) {
  .wb-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wb-words > li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .wb-words .v-word { justify-content: flex-start; }
}

/* tabs (shared .rtabs look from reading.css) */
.vtabs { margin-bottom: -4px; }
.vtabs__n { font-size: 12px; font-weight: var(--w-regular); opacity: .8; }
.vtabs__n:empty { display: none; }
.vpanel { display: grid; gap: var(--s-24); }
.vpanel[hidden] { display: none; }
@media (max-width: 640px) { .vtabs { width: 100%; } .vtabs button { flex: 1; padding-inline: 6px; font-size: 13px; } }

/* «جرّب في جملة» — the AI helper checks the student's own sentence */
.v-try { grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: var(--r-card); background: var(--canvas); border: 1px solid var(--border); }
.v-try__q { font-size: 13.5px; color: var(--ink-2); }
.v-try textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.6; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-input); background: var(--surface); color: var(--ink); resize: vertical; }
.v-try__acts { display: flex; justify-content: flex-start; }
.v-try .ai-box { margin-top: 0; }
.v-try-row { flex-basis: 100%; margin-top: 6px; }
.v-ai-intro { margin-bottom: var(--s-16); }
.v-try__q .ai-badge { margin-inline-end: 6px; vertical-align: 1px; }
/* the same panel on the review card */
.rv-try { margin-top: 14px; display: grid; justify-items: center; gap: 10px; }
.rv-try .v-try { width: 100%; text-align: start; }
.v-try-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* «اقترح معنى» */
.v-sugg { grid-column: 1 / -1; }
.v-sugg .ai-box { margin-top: 0; }
.v-sugg__ar { margin: 0; font-size: 16px; }
.v-sugg__ar b { font-weight: var(--w-semibold); color: var(--ink); }
.v-sugg__ar i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.v-sugg__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* word quiz (assets/word-quiz.js): four meanings, «لا أعرفها», then the answer with an example */
.qz-card { gap: 12px; }
.qz-ask { font-size: 14px; color: var(--ink-2); }
.qz-opts { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qz-opt { min-height: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15.5px; line-height: 1.5; cursor: pointer; text-align: center; }
.qz-opt:hover:not(:disabled) { border-color: var(--ink); }
.qz-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.qz-opt kbd { margin-inline-start: 6px; font-size: 11px; color: var(--muted); }
.qz-opt:disabled { cursor: default; }
.qz-opt.is-right { background: var(--tint-violet); border-color: var(--ink); font-weight: var(--w-semibold); }
.qz-opt.is-wrong { background: var(--tint-peach); border-color: var(--terracotta); text-decoration: line-through; text-decoration-color: var(--terracotta); }
.qz-result { min-height: 1.6em; font-size: 14.5px; font-weight: var(--w-semibold); }
.qz-result:empty { display: none; }
#qz-next[hidden], #qz-skip[hidden] { display: none; }
@media (max-width: 480px) { .qz-opts { grid-template-columns: minmax(0, 1fr); } }
.v-today__acts, .wb-head__acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v-quiznote { font-size: 13px; color: var(--muted); }

/* «طريق الإتقان» on the vocabulary page: the ladder card, the guided topics, a step on each word */
.v-path, .v-topics { display: grid; gap: 14px; margin-top: var(--s-24); }
.v-path[hidden], .v-topics[hidden] { display: none; }
.v-due__more { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.v-tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.v-tlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border-strong); }
.v-tlist li.is-now { background: var(--highlight-soft); border-color: var(--highlight-line); }
.v-tlist li.is-done { background: var(--t-vocab); border-color: var(--l-vocab); }
.v-tlist__t { display: grid; gap: 2px; min-width: 0; }
.v-tlist__t b { font-size: 16px; }
.v-tlist__t small { font-size: 13px; color: var(--muted); }
.v-tlist__bar { grid-column: 1 / -1; height: 8px; border-radius: var(--r-pill); background: var(--lilac); overflow: hidden; display: flex; }
.v-tlist__bar i { display: block; height: 100%; }
.v-tlist__bar .is-m { background: var(--c-vocab); }
.v-tlist__bar .is-l { background: var(--l-vocab); }
.v-tag { font-size: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--highlight); margin-inline-start: 8px; }
.v-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 640px) { .v-tlist li { grid-template-columns: minmax(0, 1fr); } }
