/**
 * css/pdf-worksheets.css — Styling for Bonjou PDF Pilot Worksheets
 * Modern pedagogical layout for Screen & Print (A4 format).
 */

/* ── Screen Hero & Controls ─────────────────────────────────────────────────── */
.ws-hero {
  padding: 1.75rem 1.5rem 1.25rem; /* recipe: DS:HEROES (.ws-hero) */
  margin-bottom: 1.5rem;
}

.ws-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
}

/* ── Level Filter Tabs & Worksheet Picker ───────────────────────────────────── */
.ws-level-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}

.ws-chip-level { --ds-c: var(--accent-text); font-weight: 800; }
.ws-pick-tag { flex: 0 0 auto; }

.ws-level-pill { flex: 0 0 auto; white-space: nowrap; }
.ws-level-pill small {
  opacity: 0.7;
  font-weight: 600;
}

/* ── Current Sheet Bar + Picker (M569: replaced the 60-option <select>) ─────── */
.ws-sheetbar {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.ws-step {
  flex: 0 0 auto;
  width: 44px;
  border-radius: 12px;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text, #e6edf3);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.ws-step:hover:not(:disabled) {
  border-color: var(--accent, #f5b02e);
  color: var(--accent, #f5b02e);
}
.ws-step:disabled {
  opacity: 0.35;
  cursor: default;
}

.ws-current {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 12px;
  color: var(--text, #e6edf3);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.ws-current:hover,
.ws-current[aria-expanded="true"] {
  border-color: var(--accent, #f5b02e);
}

.ws-current-num {
  flex: 0 0 auto;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #1d3a7a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.ws-current-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-current-cta {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent, #f5b02e);
  white-space: nowrap;
}

/* M570: facts about the sheet as chips (level · time · theme) */
.ws-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

/* Popover under the bar on desktop; bottom sheet on phones (see media query). */
.ws-picker-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.25);
}

.ws-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 61;
  display: flex;
  flex-direction: column;
  max-height: min(62vh, 540px);
  background: var(--surface, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.ws-picker[hidden],
.ws-picker-scrim[hidden] {
  display: none;
}

.ws-picker-head {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.5rem;
}

.ws-search {
  flex: 1;
  min-width: 0;
  background: var(--surface-2, #21262d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 9px;
  color: var(--text, #e6edf3);
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}
.ws-search:focus {
  border-color: var(--accent, #f5b02e);
}

.ws-picker-close {
  flex: 0 0 auto;
  width: 38px;
  border-radius: 9px;
  background: var(--surface-2, #21262d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text-muted, #8b949e);
  font-size: 1rem;
  cursor: pointer;
}

.ws-picker-head,
.ws-picker .ws-level-strip {
  flex-shrink: 0;
}

.ws-picker .ws-level-strip {
  padding: 0.1rem 0.75rem 0.6rem;
  margin: 0;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.ws-pick-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0.5rem 0.75rem;
}

.ws-pick-group[hidden],
.ws-pick-list li[hidden],
.ws-pick-empty[hidden] {
  display: none;
}

.ws-pick-group-title {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 0.55rem 0.5rem 0.3rem;
  background: var(--surface, #161b22);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #8b949e);
}

.ws-pick-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ws-pick-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.55rem;
  border-radius: 9px;
  color: var(--text, #e6edf3);
  text-decoration: none;
}
.ws-pick-item:hover,
.ws-pick-item:focus-visible {
  background: var(--surface-2, #21262d);
  outline: none;
}
.ws-pick-item.is-current {
  background: rgba(29, 58, 122, 0.45);
  box-shadow: inset 3px 0 0 #3b82f6;
}

.ws-pick-num {
  flex: 0 0 auto;
  width: 2rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted, #8b949e);
  font-variant-numeric: tabular-nums;
}

.ws-pick-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ws-pick-title {
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-pick-cat {
  font-size: 0.74rem;
  color: var(--text-muted, #8b949e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-pick-item.is-preview .ws-pick-tag {
  background: var(--surface-2, #21262d);
  color: var(--text-muted, #8b949e);
}
.ws-pick-item.is-preview .ws-pick-title {
  color: var(--text-muted, #8b949e);
}

.ws-pick-empty {
  margin: 1rem 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted, #8b949e);
}

.ws-badge { text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: .75rem; } /* M642: spacing lost in M636 */

.ws-title {
  font-family: 'Fredoka', 'Plus Jakarta Sans', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text, #e6edf3);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.ws-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted, #8b949e);
  margin: 0 0 1.25rem;
  max-width: 720px;
  line-height: 1.5;
}

/* ── Toolbar Bar ───────────────────────────────────────────────────────────── */
.ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.ws-tool-main,
.ws-tool-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.ws-tool-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8b949e);
}

.ws-btn-note {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
}

/* ── M570: "Correction en ligne" — the paid tools in one small hero ─────────── */
.ws-pro {
  max-width: 860px;
  margin: 0 auto 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.1rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 176, 46, 0.14), rgba(29, 58, 122, 0.28));
  border: 1px solid rgba(245, 176, 46, 0.45);
}

.ws-pro[hidden],
.ws-pro[data-state="locked"] .ws-when-unlocked,
.ws-pro[data-state="unlocked"] .ws-when-locked {
  display: none;
}

.ws-pro-art {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(245, 176, 46, 0.18);
  font-size: 1.5rem;
}

.ws-pro-title {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text, #e6edf3);
}

.ws-pro-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-muted, #8b949e);
}

.ws-pro-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #e6edf3);
}

.ws-pro-perks li::before {
  content: "✓ ";
  color: var(--accent, #f5b02e);
}

.ws-pro-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 270px;
}

.ws-pro-actions > .ws-btn {
  justify-content: center;
}

.ws-pro-row {
  display: flex;
  flex-wrap: wrap; /* M639: the reset icon drops to its own line on 320px */
  gap: 0.4rem;
}

.ws-pro-row > .ws-btn:not(.ws-btn-icon) {
  flex: 1;
  white-space: nowrap;
  justify-content: center;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

.ws-pro-login {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted, #8b949e);
}

.ws-pro-login[hidden] {
  display: none;
}

/* Locked page 2: paper with placeholder bars under a paywall card, no answers. */
.ws-page-locked {
  position: relative;
  overflow: hidden;
  min-height: 520px;
}

.ws-locked-ghost {
  filter: blur(3px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.ws-ghost-bar {
  display: block;
  height: 9px;
  margin: 0 0 9px;
  border-radius: 6px;
  background: #cbd5e1;
}

.ws-locked-cta {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  padding: 1.4rem 1.5rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #f5d38a;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
  color: #0f172a;
}

.ws-locked-cta h3 {
  margin: 0.6rem 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.ws-locked-cta p {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #475569;
}

.ws-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.2;
}

.ws-btn-primary {
  background: #1d3a7a;
  color: #ffffff;
  border-color: #2b4f9e;
}
.ws-btn-primary:hover {
  background: #254a9c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 58, 122, 0.35);
}

.ws-btn-accent {
  background: var(--accent, #f5b02e);
  color: #1b1b1f;
  font-weight: 800;
}
.ws-btn-accent:hover {
  background: #ffbe44;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 176, 46, 0.35);
}

.ws-btn-ghost {
  background: var(--surface-2, #21262d);
  color: var(--text, #e6edf3);
  border-color: var(--border, rgba(255, 255, 255, 0.12));
}
.ws-btn-ghost:hover {
  border-color: var(--accent, #f5b02e);
  color: var(--accent, #f5b02e);
}

.ws-mascot-picker {
  display: inline-flex;
  background: var(--surface-2, #21262d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.ws-picker-opt {
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted, #8b949e);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ws-picker-opt.active {
  background: var(--surface, #161b22);
  color: var(--text, #ffffff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ── Interactive Score & Feedback Banner ───────────────────────────────────── */
.ws-score-banner {
  max-width: 1040px;
  margin: 1.25rem auto 1.75rem;
  background: var(--surface, #161b22);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ws-score-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ws-score-avatar {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-score-details h4 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--text, #e6edf3);
}

.ws-score-details p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted, #8b949e);
}

.ws-score-pills {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ws-score-badge {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  background: rgba(61, 214, 140, 0.15);
  color: #3dd68c;
  border: 1px solid rgba(61, 214, 140, 0.35);
}

/* ── Worksheet Page Paper Container ────────────────────────────────────────── */
.ws-workspace {
  max-width: 860px;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.worksheet-page {
  background: #ffffff;
  color: #1e293b;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.15);
  padding: 38px 46px 42px;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

/* Tri-color Top Accent Bar */
.ws-paper-strip {
  height: 6px;
  margin: -38px -46px 26px -46px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background: linear-gradient(to right, #1d3a7a 0%, #1d3a7a 33.3%, #f5b02e 33.3%, #f5b02e 66.6%, #e0443a 66.6%, #e0443a 100%);
}

/* Header Inside Paper */
.ws-paper-header {
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.ws-paper-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ws-brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-logo-pill {
  background: #1d3a7a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 5px;
}

.ws-paper-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.ws-paper-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.ws-header-mascots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-mascot-avatar-slot {
  width: 48px;
  height: 48px;
}

/* Student Info Fields Strip */
.ws-student-info-strip {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr 1fr;
  gap: 12px;
  background: #edf2f7;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
}

.ws-info-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ws-info-label {
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.ws-info-line {
  border-bottom: 1.5px dotted #64748b;
  flex: 1;
  height: 14px;
}

.ws-info-score {
  color: #b91c1c;
  font-weight: 800;
}

/* Mascot Tips Banner */
.ws-tips-card {
  background: #fef9ee;
  border: 1.5px solid #f5b02e;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ws-tips-icon-slot {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.ws-tips-content {
  flex: 1;
}

.ws-tip-line {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #1e293b;
}
.ws-tip-line:last-child {
  margin-bottom: 0;
}

.ws-tip-renard strong {
  color: #c25e00;
}
.ws-tip-hermeline strong {
  color: #be185d;
}

/* Exercises Layout */
.ws-exercise-block {
  margin-bottom: 22px;
}

.ws-exercise-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ws-ex-num {
  background: #1d3a7a;
  color: #ffffff;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.ws-ex-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ws-ex-pts {
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
}

/* Exercise 1 : Vocab Table */
.ws-vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 12px;
}

.ws-vocab-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-vocab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.ws-vocab-term {
  font-weight: 700;
  color: #1e293b;
}

.ws-vocab-match-box {
  width: 28px;
  height: 22px;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
}

.ws-vocab-def {
  color: #334155;
  line-height: 1.35;
}

/* Exercise 2 : Conjugation */
.ws-conj-list {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 12px;
}

.ws-conj-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.4;
}

.ws-input {
  border: none;
  border-bottom: 1.5px solid #475569;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  padding: 1px 4px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s ease;
}
.ws-input:focus {
  border-bottom-color: #1d3a7a;
  background: #f1f5f9;
}
.ws-input.correct {
  color: #047857;
  border-bottom-color: #059669;
  background: rgba(16, 185, 129, 0.1);
}
.ws-input.incorrect {
  color: #b91c1c;
  border-bottom-color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

.ws-conj-input {
  width: 140px;
}

/* Exercise 3 : Reading Passage */
.ws-story-box {
  background: #f1f5f9;
  border-left: 4px solid #1d3a7a;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #1e293b;
  font-style: italic;
  margin-bottom: 12px;
}

.ws-questions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.ws-q-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ws-q-label {
  font-weight: 600;
  color: #1e293b;
}

.ws-answer-line {
  border-bottom: 1.5px dotted #94a3b8;
  height: 18px;
  width: 100%;
}

.ws-checkbox-group {
  display: inline-flex;
  gap: 16px;
  margin-left: 10px;
  font-weight: 700;
}

/* Exercise 4 : Scramble & Production */
.ws-scramble-box {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-words-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 6px;
}

.ws-word-chip {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 600;
  font-size: 11px;
}

/* Footer Encouragement inside Worksheet */
.ws-paper-footer-cheer {
  border: 1.5px solid #34d399;
  background: #f0fdf4;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.ws-cheer-avatar-slot {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.ws-cheer-text h5 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 800;
  color: #065f46;
}

.ws-cheer-text p {
  margin: 0;
  font-size: 11px;
  color: #047857;
  line-height: 1.4;
}

/* Official Bottom Microprint */
.ws-paper-bottom-meta {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
}

/* ── PAGE 2 : CORRIGÉ & GRILLE PÉDAGOGIQUE ─────────────────────────────────── */
.ws-ans-key-tag {
  background: #c0392b; /* M621: AA for white text */
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
}

.ws-solution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.ws-solution-card {
  border: 1px solid #86efac;
  background: #f0fdf4;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #14532d;
}

.ws-solution-card h6 {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: #166534;
}

.ws-cecrl-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 20px;
  font-size: 11px;
}

.ws-cecrl-table th {
  background: #1d3a7a;
  color: #ffffff;
  padding: 7px 10px;
  text-align: left;
  font-weight: 700;
}

.ws-cecrl-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  color: #334155;
}

.ws-cecrl-table tr:nth-child(even) td {
  background: #f8fafc;
}

.ws-seal-card {
  border: 1.5px dashed #f5b02e;
  background: #fffbeb;
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.ws-seal-avatar-slot {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.ws-seal-content h5 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #b45309;
}

.ws-seal-content ul {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  color: #78350f;
  line-height: 1.45;
}

/* ── Inline Answer Revealer in Worksheet ───────────────────────────────────── */
.ws-answer-reveal {
  display: none;
  color: #047857;
  font-weight: 700;
  background: #d1fae5;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-size: 11px;
}

body.show-answers .ws-answer-reveal {
  display: inline-block;
}

/* ── Sheet summary (server-rendered for crawlers; catalogue-only sheets) ───── */
.ws-summary-page {
  text-align: left;
}

.ws-summary-title {
  font-size: 22px;
  color: #0f172a;
  margin: 0 0 10px;
}

.ws-summary-desc {
  color: #475569;
  margin: 0 0 18px;
  line-height: 1.55;
}

.ws-summary-facts {
  list-style: none;
  margin: 0;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
}

.ws-summary-next {
  margin-top: 24px;
}
.ws-summary-next p {
  color: #334155;
  margin: 0 0 12px;
}

.ws-soon-tag { margin-bottom: 10px; }

/* ── Toolbar states ────────────────────────────────────────────────────────── */
.ws-lock {
  font-size: 0.8em;
  margin-left: 0.1rem;
}
.ws-lock[hidden] {
  display: none;
}

.ws-btn-icon {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.ws-btn:disabled,
.ws-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ── Phones ────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ws-hero {
    padding: 1.1rem 1rem 1rem;
    margin-bottom: 1rem;
  }

  .ws-badge {
    font-size: 0.7rem;
  }

  .ws-title {
    font-size: 1.5rem;
  }

  .ws-subtitle {
    font-size: 0.92rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ws-current {
    flex-wrap: wrap;
    gap: 0.3rem 0.6rem;
    padding: 0.6rem 0.75rem;
  }

  .ws-current-title {
    flex-basis: 100%;
    order: 3;
    font-size: 0.92rem;
  }

  .ws-current-cta {
    margin-left: auto;
  }

  /* Bottom sheet: never taller than most of the screen. */
  .ws-picker {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 78vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .ws-picker-scrim {
    background: rgba(0, 0, 0, 0.55);
  }

  body.ws-picker-open {
    overflow: hidden;
  }

  .ws-pick-item {
    padding: 0.65rem 0.5rem;
  }

  .ws-toolbar {
    padding: 0.65rem;
    gap: 0.5rem;
    border-radius: 12px;
  }

  .ws-tool-main,
  .ws-tool-side {
    width: 100%;
    gap: 0.4rem;
  }

  .ws-pro {
    margin: 0 1rem 1rem;
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .ws-pro-art {
    display: none;
  }

  .ws-pro-actions {
    min-width: 0;
  }

  .ws-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
  }

  .ws-tool-main > .ws-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .ws-mascot-picker {
    flex: 1 1 100%;
  }

  .ws-picker-opt {
    flex: 1;
    padding: 0.38rem 0.4rem;
    white-space: nowrap;
  }

  .ws-score-banner {
    margin: 0.75rem 1rem 1rem;
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .ws-workspace {
    padding: 0 0.6rem;
    gap: 1.25rem;
  }

  .worksheet-page {
    padding: 22px 16px 26px;
  }

  .ws-paper-strip {
    margin: -22px -16px 18px -16px;
  }

  .ws-paper-header-top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ws-student-info-strip,
  .ws-vocab-grid,
  .ws-solution-grid {
    grid-template-columns: 1fr;
  }

  .ws-cecrl-table {
    display: block;
    overflow-x: auto;
  }
}

/* ── Print Specific Styles ─────────────────────────────────────────────────── */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt !important;
  }

  .no-print,
  #nav-bar,
  #sidebar,
  #sidebar-overlay,
  #bj-consent,
  .ws-hero,
  .ws-score-banner {
    display: none !important;
  }

  .ws-workspace {
    max-width: 100% !important;
    margin: 0 !important;
    gap: 0 !important;
  }

  .worksheet-page {
    box-shadow: none !important;
    border: none !important;
    padding: 0 0 10mm 0 !important;
    page-break-after: always !important;
    break-after: page !important;
  }

  .worksheet-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .ws-paper-strip {
    margin: 0 0 14pt 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ws-paper-header,
  .ws-tips-card,
  .ws-vocab-grid,
  .ws-conj-list,
  .ws-story-box,
  .ws-scramble-box,
  .ws-solution-card,
  .ws-paper-footer-cheer,
  .ws-seal-card {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .ws-input {
    border-bottom: 1pt solid #000000 !important;
  }
}


/* M643: worksheet blanks are inline lines on the sheet — no 44px box on phones */
@media (max-width:767px){input.ws-input{min-height:0}input.ws-vocab-match-box{min-height:32px;min-width:32px}}
