/* ─────────────────────────────────────────────────────────────────
   IELTS Writing — category grid with FLIP-based expand/collapse.
   The same .wr-cat-block element morphs from a small grid cell into
   the full expanded panel — no DOM swap mid-animation.
   ───────────────────────────────────────────────────────────── */

.wr-cat-section {
  margin-top: 2rem;
}

/* ── 6-block grid (collapsed) ────────────────────────────────── */
.wr-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 1rem;
  position: relative;
}

/* When expanded, the grid stays as grid; the active block spans
   all cells (1/-1) so it visually fills the area. */
.wr-cat-grid.is-expanded {
  grid-auto-rows: auto;
}
.wr-cat-grid.is-expanded .wr-cat-block.is-active {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

/* ── Category block (works in both states) ───────────────────── */
.wr-cat-block {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: .55rem;
  padding: 1.6rem 1.6rem 1.4rem;
  background: var(--paper, #F5EBD3);
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--paper-ink, #1F1812);
  overflow: hidden;
  user-select: none;
  box-shadow:
    0 1px 0 rgba(0,0,0,.18),
    0 14px 26px -18px rgba(0,0,0,.45);
  transition: opacity .35s ease,
              border-color .2s,
              box-shadow .25s,
              transform .18s cubic-bezier(.2,.8,.2,1);
}
.wr-cat-block:hover:not(.is-active) {
  transform: translateY(-3px);
  border-color: var(--paper-honey, #B57A2E);
  box-shadow:
    0 1px 0 rgba(0,0,0,.18),
    0 22px 42px -16px rgba(0,0,0,.55);
}

/* Stripe accent. */
.wr-cat-stripe {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: .35rem;
  background: var(--cat-color, #B57A2E);
  transition: width .25s ease, height .25s ease;
}

/* Per-category accent. */
.wr-cat-foundations       { --cat-color: #B57A2E; }
.wr-cat-writing-the-parts { --cat-color: #7E5A3A; }
.wr-cat-quality-skills    { --cat-color: #4F7A4A; }
.wr-cat-common-pitfalls   { --cat-color: #A85B47; }
.wr-cat-topic-vocabulary  { --cat-color: #3F6E7A; }
.wr-cat-task-1            { --cat-color: #6B4E7A; }

.wr-cat-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--paper-ink, #1F1812);
}
.wr-cat-tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .88rem;
  line-height: 1.4;
  color: var(--paper-ink-soft, #4A3F33);
  flex: 1;
}
.wr-cat-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cat-color, #B57A2E);
  margin-top: .35rem;
}

/* ── Active (expanded) state ─────────────────────────────────── */
.wr-cat-block.is-active {
  cursor: default;
  padding: 1.8rem 1.8rem 2rem;
  border-color: var(--cat-color);
  box-shadow:
    0 1px 0 rgba(0,0,0,.22),
    0 22px 50px -18px rgba(0,0,0,.55);
}
.wr-cat-block.is-active:hover {
  transform: none;
}
.wr-cat-block.is-active .wr-cat-stripe {
  width: 48px;
  height: 5px;
}
.wr-cat-block.is-active .wr-cat-name {
  font-size: 2rem;
  letter-spacing: -.015em;
}
.wr-cat-block.is-active .wr-cat-tagline {
  font-size: .95rem;
  flex: 0 0 auto;
}

/* ── Non-active blocks during expand ─────────────────────────── */
.wr-cat-block.is-collapsing {
  opacity: 0;
  transform: scale(.85);
  pointer-events: none;
}

/* ── Injected pieces (back button + lessons list) ────────────── */
.wr-cat-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: transparent;
  border: 0;
  font: inherit;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--paper-honey, #B57A2E);
  cursor: pointer;
  padding: .25rem .35rem;
  margin: -.4rem 0 .8rem -.35rem;
  border-radius: 6px;
  opacity: 1;
  transition: opacity .25s ease, background .15s, color .15s;
}
.wr-cat-back.is-pre-fade {
  opacity: 0;
}
.wr-cat-back:hover {
  background: rgba(181,122,46,.10);
  color: var(--paper-ink, #1F1812);
}

.wr-cat-lessons {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-top: 1.1rem;
  opacity: 1;
  transition: opacity .3s ease;
}
.wr-cat-lessons.is-pre-fade {
  opacity: 0;
}

/* ── Lesson card inside expanded view ────────────────────────── */
.wr-cat-lesson {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.4rem;
  padding: 1.05rem 1.4rem;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(31,24,18,.10);
  border-radius: 10px;
  text-decoration: none;
  color: var(--paper-ink, #1F1812);
  transition: transform .18s cubic-bezier(.2,.8,.2,1),
              border-color .2s, background .2s, box-shadow .2s;
}
.wr-cat-lesson:hover {
  transform: translateX(4px);
  border-color: var(--cat-color, #B57A2E);
  background: rgba(255,255,255,.7);
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.4);
}
.wr-cat-lesson .rd-lesson-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  line-height: .9;
  color: var(--cat-color, #B57A2E);
  letter-spacing: -.02em;
  font-variant-numeric: oldstyle-nums;
  align-self: center;
}
.wr-cat-lesson .rd-lesson-body {
  display: flex; flex-direction: column; gap: .15rem;
  min-width: 0;
}
.wr-cat-lesson .rd-lesson-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.2;
  color: var(--paper-ink, #1F1812);
}
.wr-cat-lesson .rd-lesson-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  color: var(--paper-ink-soft, #4A3F33);
  line-height: 1.4;
}
.wr-cat-lesson-mins {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .78rem;
  color: var(--paper-ink-soft, #4A3F33);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────
   Dissect — stacked sentence/note pairs.
   Each sentence sits directly above its annotation. No scrolling
   between them, no click interaction needed.
   ───────────────────────────────────────────────────────────── */
.wr-dis-pairs {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.wr-dis-pair {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.wr-dis-sentence {
  margin: 0;
  padding: .85rem 1.05rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--paper-ink, #1F1812);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(31, 24, 18, .12);
  border-radius: 10px;
  border-left: 4px solid var(--paper-line, rgba(31, 24, 18, .18));
}
.wr-dis-pair.wr-dis-role-topic       .wr-dis-sentence { border-left-color: var(--paper-honey, #B57A2E); }
.wr-dis-pair.wr-dis-role-evidence    .wr-dis-sentence { border-left-color: var(--paper-honey, #B57A2E); }
.wr-dis-pair.wr-dis-role-detail      .wr-dis-sentence { border-left-color: var(--paper-ink-mute, #7A6A55); }
.wr-dis-pair.wr-dis-role-contrast    .wr-dis-sentence { border-left-color: var(--paper-ember, #B6442C); }
.wr-dis-pair.wr-dis-role-conclusion  .wr-dis-sentence { border-left-color: var(--paper-ember, #B6442C); }
.wr-dis-pair.wr-dis-role-transition  .wr-dis-sentence { border-left-color: var(--paper-ink-soft, #4A3F33); }

.wr-dis-note {
  margin-left: 1rem;
  padding: .7rem 1rem .8rem;
  background: transparent;
  border: 0;
  border-left: 2px solid var(--paper-line, rgba(31, 24, 18, .15));
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.wr-dis-pair.wr-dis-role-topic       .wr-dis-note { border-left-color: var(--paper-honey, #B57A2E); }
.wr-dis-pair.wr-dis-role-evidence    .wr-dis-note { border-left-color: var(--paper-honey, #B57A2E); }
.wr-dis-pair.wr-dis-role-detail      .wr-dis-note { border-left-color: var(--paper-ink-mute, #7A6A55); }
.wr-dis-pair.wr-dis-role-contrast    .wr-dis-note { border-left-color: var(--paper-ember, #B6442C); }
.wr-dis-pair.wr-dis-role-conclusion  .wr-dis-note { border-left-color: var(--paper-ember, #B6442C); }
.wr-dis-pair.wr-dis-role-transition  .wr-dis-note { border-left-color: var(--paper-ink-soft, #4A3F33); }

.wr-dis-note-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--paper-honey, #B57A2E);
}
.wr-dis-pair.wr-dis-role-detail      .wr-dis-note-label,
.wr-dis-pair.wr-dis-role-transition  .wr-dis-note-label { color: var(--paper-ink-soft, #4A3F33); }
.wr-dis-pair.wr-dis-role-contrast    .wr-dis-note-label,
.wr-dis-pair.wr-dis-role-conclusion  .wr-dis-note-label { color: var(--paper-ember, #B6442C); }

.wr-dis-note-body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--paper-ink, #1F1812);
}
.wr-dis-note-body b { font-weight: 600; }
.wr-dis-note-body i { font-style: italic; }

@media (max-width: 560px) {
  .wr-dis-note { margin-left: .55rem; padding: .55rem .75rem .65rem; }
  .wr-dis-sentence { font-size: 1rem; padding: .7rem .85rem; }
}

/* ─────────────────────────────────────────────────────────────────
   Quiz block — classify-the-prompt / classify-the-transition drills.
   ───────────────────────────────────────────────────────────── */
.wr-quiz-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.wr-quiz-q {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.wr-quiz-q-num {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--paper-honey, #B57A2E);
  font-variant-numeric: oldstyle-nums;
  padding-top: .15rem;
}
.wr-quiz-q-body {
  min-width: 0;
}
.wr-quiz-stem {
  margin: 0 0 .8rem;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--paper-ink, #1F1812);
}
.wr-quiz-stem i {
  color: var(--paper-ink-soft, #4A3F33);
}
.wr-quiz-opts {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.wr-quiz-opt {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(31, 24, 18, .15);
  border-radius: 999px;
  font: inherit;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 500;
  color: var(--paper-ink, #1F1812);
  cursor: pointer;
  text-align: left;
  transition: background .18s, border-color .18s, transform .12s, opacity .18s;
}
.wr-quiz-opt-label {
  text-align: left;
  flex: 1;
}
.wr-quiz-opt-mark { flex-shrink: 0; }
.wr-quiz-opt:hover {
  background: rgba(255, 255, 255, .85);
  border-color: var(--paper-honey, #B57A2E);
  transform: translateY(-1px);
}
.wr-quiz-opt-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(31, 24, 18, .3);
  flex-shrink: 0;
  display: inline-block;
  position: relative;
  transition: border-color .18s, background .18s;
}

/* After answer is given — reveal correct/wrong on every option. */
.wr-quiz-opt.is-revealed {
  pointer-events: auto;
}
.wr-quiz-opt.is-revealed[data-correct="true"] {
  background: rgba(79, 122, 74, .14);
  border-color: rgba(79, 122, 74, .55);
  color: #2A4527;
}
.wr-quiz-opt.is-revealed[data-correct="true"] .wr-quiz-opt-mark {
  background: #4F7A4A;
  border-color: #4F7A4A;
}
.wr-quiz-opt.is-revealed[data-correct="true"] .wr-quiz-opt-mark::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.wr-quiz-opt.is-revealed[data-correct="false"]:not(.is-picked) {
  opacity: .5;
}
.wr-quiz-opt.is-revealed[data-correct="false"].is-picked {
  background: rgba(168, 91, 71, .14);
  border-color: rgba(168, 91, 71, .55);
  color: #5A2918;
}
.wr-quiz-opt.is-revealed[data-correct="false"].is-picked .wr-quiz-opt-mark {
  background: #A85B47;
  border-color: #A85B47;
}
.wr-quiz-opt.is-revealed[data-correct="false"].is-picked .wr-quiz-opt-mark::after {
  content: '✗';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.wr-quiz-opt.is-picked {
  transform: translateY(0);
}

/* Feedback note shown below the options after answer. */
.wr-quiz-feedback {
  margin-top: .8rem;
}
.wr-quiz-note {
  padding: .8rem 1rem;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, .55);
  border-left: 3px solid var(--paper-honey, #B57A2E);
}
.wr-quiz-note[data-correct="true"] {
  background: rgba(79, 122, 74, .10);
  border-left-color: #4F7A4A;
  color: #1F1812;
}
.wr-quiz-note[data-correct="false"] {
  background: rgba(168, 91, 71, .10);
  border-left-color: #A85B47;
  color: #1F1812;
}
.wr-quiz-note b { font-weight: 600; }
.wr-quiz-note i { font-style: italic; }

/* ─────────────────────────────────────────────────────────────────
   God-only inline edit mode — pen FAB + contenteditable styling.
   ───────────────────────────────────────────────────────────── */
.wr-edit-fab {
  position: fixed;
  top: 5.5rem;
  right: 1.4rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .85rem;
  background: var(--paper, #F5EBD3);
  color: var(--paper-ink, #1F1812);
  border: 1px solid rgba(31, 24, 18, .2);
  border-radius: 999px;
  font: inherit;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(0,0,0,.18),
    0 12px 28px -14px rgba(0,0,0,.55);
  transition: transform .15s, box-shadow .2s, background .15s;
}
.wr-edit-fab:hover {
  transform: translateY(-1px);
  background: var(--paper-tint, #EFE2C4);
  box-shadow:
    0 1px 0 rgba(0,0,0,.18),
    0 18px 32px -14px rgba(0,0,0,.6);
}
.wr-edit-fab.is-active {
  background: var(--paper-honey, #B57A2E);
  color: #FFF8E7;
  border-color: var(--paper-honey, #B57A2E);
}
.wr-edit-fab svg { flex-shrink: 0; }

/* Editing state — every editable element gets a subtle ring on hover,
   stronger when focused. The save flash is a brief green tint. */
body.is-editing-lesson [data-edit-key] {
  outline: 1px dashed rgba(181, 122, 46, .35);
  outline-offset: 3px;
  border-radius: 3px;
  transition: outline-color .15s, background .15s;
  cursor: text;
}
body.is-editing-lesson [data-edit-key]:hover {
  outline: 1px dashed rgba(181, 122, 46, .8);
  background: rgba(181, 122, 46, .05);
}
body.is-editing-lesson [data-edit-key]:focus {
  outline: 2px solid var(--paper-honey, #B57A2E);
  background: rgba(255, 255, 255, .6);
}
body.is-editing-lesson [data-edit-key].is-edit-saved {
  outline: 2px solid #4F7A4A;
  background: rgba(79, 122, 74, .14);
}

/* While editing, dim the dissect/quiz interactions so the editor
   doesn't accidentally trigger highlight clicks. */
body.is-editing-lesson .rd-dis-sent,
body.is-editing-lesson .wr-dis-note,
body.is-editing-lesson .wr-quiz-opt {
  pointer-events: none;
  opacity: .85;
}

/* ─────────────────────────────────────────────────────────────────
   Task 1 chart blocks — line graphs, bar charts, pies, tables,
   maps, process diagrams. All rendered as inline SVG with the
   same paper aesthetic + a unified label/title typography.
   ───────────────────────────────────────────────────────────── */
.wr-chart {
  margin: 1.6rem 0;
  padding: 18px 18px 14px;
  background: rgba(255, 250, 232, .55);
  border: 1px solid rgba(31, 24, 18, .12);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 4px 12px -8px rgba(0, 0, 0, .15);
}
.wr-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
}
.wr-chart-caption {
  margin: 10px 4px 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--paper-ink-soft, #4A3F33);
  font-style: italic;
  text-align: center;
}

/* Chart text styles (shared across SVG types). Targeted at <text> and
   uses class-based selectors that work inside SVG. */
.wr-chart-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  fill: #1F1812;
}
.wr-chart-title-text {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.04rem;
  font-weight: 600;
  margin: 0 0 12px;
  text-align: center;
  color: var(--paper-ink, #1F1812);
}
.wr-chart-tick {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  fill: #4A3F33;
}
.wr-chart-axis-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  fill: #4A3F33;
  font-weight: 600;
  letter-spacing: .04em;
}
.wr-chart-legend {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  fill: #1F1812;
}
.wr-chart-bar-value {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  fill: #4A3F33;
}
.wr-chart-pie-pct {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #FFFAE8;
  paint-order: stroke;
  stroke: rgba(31, 24, 18, .35);
  stroke-width: 0.6px;
}
.wr-chart-pie-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--paper-ink-soft, #4A3F33);
}

/* Map labels (inside SVG) */
.wr-map-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  fill: #1F1812;
  letter-spacing: .01em;
}
.wr-map-label-water {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9.5px;
  font-style: italic;
  fill: #2F4F5C;
}
.wr-map-label-green {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9.5px;
  font-style: italic;
  fill: #2F4527;
}
.wr-map-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  fill: #1F1812;
  font-style: italic;
}
.wr-map-n {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  fill: #4A3F33;
}

/* Process diagram labels (inside SVG) */
.wr-process-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #FFFAE8;
}
.wr-process-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  fill: #1F1812;
  line-height: 1.3;
}

/* Data table — Task 1 style data presentation. */
.wr-chart-datatable .wr-dt-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(31, 24, 18, .12);
}
.wr-chart-datatable .wr-dt {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .9rem;
  background: rgba(255, 250, 232, .85);
}
.wr-chart-datatable .wr-dt-h {
  background: rgba(31, 24, 18, .08);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--paper-ink-soft, #4A3F33);
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(31, 24, 18, .15);
  border-right: 1px solid rgba(31, 24, 18, .06);
}
.wr-chart-datatable .wr-dt-h:first-child {
  text-align: left;
}
.wr-chart-datatable .wr-dt-h:last-child {
  border-right: 0;
}
.wr-chart-datatable .wr-dt-rowhead {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  color: var(--paper-ink, #1F1812);
  padding: 9px 12px;
  border-bottom: 1px solid rgba(31, 24, 18, .07);
  border-right: 1px solid rgba(31, 24, 18, .06);
  background: rgba(31, 24, 18, .03);
}
.wr-chart-datatable .wr-dt-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--paper-ink, #1F1812);
  padding: 9px 12px;
  border-bottom: 1px solid rgba(31, 24, 18, .07);
  border-right: 1px solid rgba(31, 24, 18, .06);
}
.wr-chart-datatable .wr-dt tr:last-child .wr-dt-rowhead,
.wr-chart-datatable .wr-dt tr:last-child .wr-dt-cell {
  border-bottom: 0;
}
.wr-chart-datatable .wr-dt-cell:last-child,
.wr-chart-datatable .wr-dt-rowhead:last-child {
  border-right: 0;
}

@media (max-width: 600px) {
  .wr-chart { padding: 10px 8px 8px; }
  .wr-chart-title { font-size: 12px; }
  .wr-chart-tick, .wr-chart-axis-label { font-size: 9.5px; }
  .wr-chart-legend { font-size: 10.5px; }
}

/* ─────────────────────────────────────────────────────────────────
   Vocabulary table — 3-column collocation bank used by topic-vocab.
   On wide screens it renders as a real table (phrase | meaning |
   example); on narrow screens it stacks each row into a card so the
   reader never side-scrolls.
   ───────────────────────────────────────────────────────────── */
.wr-vocabtable { margin-top: 1.4rem; }
.wr-vt-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(31, 24, 18, .12);
}
.wr-vt {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--paper-ink, #1F1812);
}
.wr-vt thead th {
  position: sticky;
  top: 0;
  background: rgba(31, 24, 18, .06);
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--paper-ink-soft, #4A3F33);
  text-align: left;
  padding: .65rem .95rem;
  border-bottom: 1px solid rgba(31, 24, 18, .14);
}
.wr-vt tbody td {
  padding: .65rem .95rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(31, 24, 18, .07);
}
.wr-vt tbody tr:last-child td { border-bottom: 0; }
.wr-vt tbody tr:hover td { background: rgba(255, 255, 255, .55); }

.wr-vt-phrase {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  color: #8B5A1C;
  width: 26%;
}
.wr-vt-meaning {
  color: var(--paper-ink-soft, #4A3F33);
  width: 28%;
}
.wr-vt-example {
  color: var(--paper-ink, #1F1812);
  font-style: italic;
}
.wr-vt-example b {
  font-style: normal;
  font-weight: 600;
  color: #8B5A1C;
  background: rgba(181, 122, 46, .10);
  padding: 0 3px;
  border-radius: 3px;
}

@media (max-width: 720px) {
  .wr-vt thead { display: none; }
  .wr-vt, .wr-vt tbody { display: block; }
  .wr-vt tbody tr {
    display: block;
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(31, 24, 18, .1);
  }
  .wr-vt tbody tr:last-child { border-bottom: 0; }
  .wr-vt tbody td {
    display: block;
    border: 0;
    padding: 0;
    width: auto;
  }
  .wr-vt-phrase {
    font-size: 1.04rem;
    margin-bottom: .25rem;
  }
  .wr-vt-meaning {
    font-size: .82rem;
    margin-bottom: .35rem;
    color: var(--paper-ink-mute, #7A6A55);
  }
  .wr-vt-example { font-size: .92rem; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .wr-cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .wr-cat-grid {
    grid-template-columns: 1fr;
  }
  .wr-cat-name { font-size: 1.3rem; }
  .wr-cat-block.is-active { padding: 1.2rem 1.1rem 1.5rem; }
  .wr-cat-block.is-active .wr-cat-name { font-size: 1.6rem; }
  .wr-cat-lesson {
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: .9rem 1.1rem;
  }
  .wr-cat-lesson-mins {
    grid-column: 2;
    grid-row: 2;
    margin-top: .15rem;
  }
}
