:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a202c;
  --muted: #5a6577;
  --border: #d5dbe4;
  --accent: #3182ce;
  --accent-dark: #2b6cb0;
  --accent-soft: #ebf8ff;
  --good: #2f855a;
  --good-soft: #e6f6ec;
  --bad: #c53030;
  --bad-soft: #fdecec;
  --warn: #975a16;
  --warn-soft: #fef5e7;
  /* The quiz game's four answers (white text on each), and gold for the winner */
  --game-1: #c53030;
  --game-2: #2b6cb0;
  --game-3: #6b46c1;
  --game-4: #2f855a;
  --game-gold: #d69e2e;
  --radius: 10px;
  --radius-sm: 6px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-sheet: Arial, Helvetica, sans-serif;
  --font-he: "Noto Sans Hebrew", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
}

[lang="he"] { font-family: var(--font-he); }

a { color: var(--accent-dark); }

.topbar {
  background: var(--accent-dark);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
}
/* Main menu: a white bar under the blue header, like a row of tabs */
.mainnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.mainnav[hidden] { display: none; }
.mainnav-inner {
  display: flex;
  gap: 4px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.mainnav-link {
  padding: 14px 16px 11px;
  border-bottom: 3px solid transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mainnav-link:hover { color: var(--accent-dark); background: var(--accent-soft); }
.mainnav-link.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.mainnav-link .live-dot.on { margin-right: 5px; vertical-align: 1px; }
.mainnav-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.test-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.topnav-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: #fff;
  font-size: .9rem;
  white-space: nowrap;
}
.topnav-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.topnav-out {
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-sm);
  background: none;
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.topnav-out:hover { background: rgba(255, 255, 255, .14); }
/* The English / Español menu, styled like the Sign out button */
.lang-select {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.lang-select:hover { background: rgba(255, 255, 255, .14); }
.lang-select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lang-select option { background: var(--surface); color: var(--text); }
.topnav-out:focus-visible, .brand:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.brand span { font-weight: 400; margin-left: 6px; opacity: .9; }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 4px; }
.lede, .hint { color: var(--muted); margin: 0 0 20px; }
.hint { font-size: .9rem; margin: 8px 0 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn:focus-visible, .option:focus-visible, .match-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Home */
.lesson-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lesson-card {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}
.lesson-card:hover { border-color: var(--accent); }
.lesson-latest { color: var(--accent-dark); font-size: .85rem; font-weight: 600; }
.lesson-title { font-size: 1.15rem; font-weight: 700; }
.lesson-meta { color: var(--muted); font-size: .9rem; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }

/* Championship board, at the top of the Lessons page */
.card.champ-board { margin-bottom: 20px; padding: 16px 18px; }
.champ-last {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}
.champ-cup { flex: none; font-size: 1.7rem; line-height: 1; }
.champ-last-points { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.champ-title { margin: 0 0 8px; color: var(--accent-dark); font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.champ-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.champ-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.champ-list li.mine { background: var(--accent-soft); }
.champ-place { flex: none; width: 1.7em; text-align: center; font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.champ-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.champ-points { flex: none; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.champ-empty { margin: 0; color: var(--muted); }
.champ-me { margin: 10px 0 0; color: var(--accent-dark); font-weight: 600; }
.champ-me-more { margin-top: 10px; }
.champ-me-more summary { color: var(--accent-dark); font-weight: 600; cursor: pointer; }
.champ-hidden { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.champ-parts { display: grid; gap: 2px; max-width: 280px; margin: 6px 0 0; padding: 0 0 0 18px; list-style: none; color: var(--muted); font-size: .9rem; }
.champ-parts li { display: flex; justify-content: space-between; gap: 12px; }
.champ-parts-points { flex: none; font-variant-numeric: tabular-nums; }
.champ-how { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.champ-how summary { color: var(--accent-dark); font-weight: 600; cursor: pointer; }
.champ-how ul { margin: 6px 0; padding-left: 20px; }
.champ-how p { margin: 0; }
.notice.error { background: var(--bad-soft); color: var(--bad); }

/* Read by screen readers, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Lesson header */
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; }
.lesson-head h1 { margin-bottom: 12px; }
/* Quiz and Word by word: the lesson chosen, under the Self study buttons */
.study-lesson { margin: 0 0 10px; font-size: 1.1rem; line-height: 1.35; }

/* Self study menu */
.subtabs { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subtab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.subtab:hover { border-color: var(--accent); }
.subtab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.subtab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Word of the day: today's and the past week's words, under the card */
.wotd-days { margin-top: 20px; }
.wotd-days-title { margin: 0 0 8px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.wotd-day-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wotd-day { font-family: inherit; line-height: inherit; cursor: pointer; }
.wotd-day-done { margin-left: 5px; color: var(--good); }

/* Quiz and Word by word: a button that opens the list of lessons, shown below all the buttons */
.subtab-picker { display: inline-flex; align-items: center; gap: 4px; padding-right: 10px; font-family: inherit; line-height: inherit; cursor: pointer; }
.subtab-caret {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .15s;
}
.subtab-picker[aria-expanded="true"] .subtab-caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .subtab-caret { transition: none; } }
.lesson-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(420px, 100%);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.lesson-menu[hidden] { display: none; }
.lesson-menu-title { margin: 4px 10px 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.lesson-menu ul { margin: 0; padding: 0; list-style: none; }
.lesson-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.lesson-menu a:hover { background: var(--bg); }
.lesson-menu a.current { background: var(--accent-soft); }
.lesson-menu a:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.lesson-menu-text { flex: 1; display: grid; gap: 2px; }
.lesson-menu-number { color: var(--muted); font-size: .78rem; font-weight: 600; }
.lesson-menu a.current .lesson-menu-number { color: var(--accent-dark); }
.lesson-menu-name { font-size: .95rem; font-weight: 600; line-height: 1.3; }
.lesson-menu-check { color: var(--accent-dark); font-weight: 700; }

/* Resources: the lesson's video */
.resource-list { display: grid; gap: 10px; }
.resource {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.resource:hover { border-color: var(--accent); }
.resource:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.resource-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1.1rem;
}
.resource-text { display: grid; gap: 2px; min-width: 0; }
.resource-kind { color: var(--accent-dark); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.resource-title { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.resource-meta { color: var(--muted); font-size: .85rem; }
.resource-picture {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.resource-picture img { display: block; width: 100%; height: auto; }
a.resource-meta { color: var(--accent-dark); justify-self: start; }

/* List of a lesson's quizzes */
.quiz-best { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quiz-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.quiz-pick {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.quiz-pick:hover { border-color: var(--accent); }
.quiz-pick:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.quiz-pick-name { font-size: 1.15rem; font-weight: 700; }
.quiz-pick-meta { color: var(--muted); font-size: .9rem; }
.quiz-pick .score-pill { font-size: .9rem; font-weight: 600; }

/* Sign-in */
.signin { max-width: 460px; margin: 0 auto; }
.field-hint { color: var(--muted); font-size: .85rem; }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* Word of the day and How to say */
.word-card.wotd-card, .word-card.say-result { min-height: 0; padding-bottom: 28px; }
.wotd-actions { justify-content: center; }
.say-result { margin-top: 16px; }
.say-result .card-en { border-bottom: 0; padding-bottom: 0; color: var(--muted); font-weight: 400; font-size: 1.25rem; }
.btn:disabled { opacity: .6; cursor: default; }
/* How to say: the microphone at the end of the English box */
.say-input { position: relative; display: grid; }
.say-input.with-mic input { padding-right: 52px; }
.mic-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--accent-dark);
  cursor: pointer;
}
.mic-btn:hover:not(:disabled) { background: var(--accent-soft); }
.mic-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mic-btn:disabled { opacity: .45; cursor: default; }
.mic-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic-btn svg .fill { fill: currentColor; }
.mic-btn.listening { background: var(--bad-soft); color: var(--bad); animation: live-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mic-btn.listening { animation: none; } }
.say-listening { margin: -8px 0 0; color: var(--bad); font-size: .9rem; font-weight: 600; }

/* Suggestions box */
.field.wide { max-width: none; margin-top: 0; }
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
}
.list-title { font-size: 1.15rem; margin: 28px 0 12px; }
.suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.suggestion { padding: 16px 18px; }
.suggestion-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 0 0 4px; }
.suggestion-head .muted { font-size: .85rem; }
.only-teacher { font-size: .8rem; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-sm); padding: 1px 8px; }
/* Who can read a new suggestion */
.audience { border: 0; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.audience legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.audience-choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.audience-choice input { width: 18px; height: 18px; margin: 0; }
.suggestion-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.response { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.response-none { margin: 10px 0 0; font-size: .9rem; }
.response-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.response-form .field { margin-bottom: 10px; }

/* Progress reports */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--accent-dark); line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .85rem; }
.week-grid th, .week-grid td { padding: 10px 8px; }
.week-grid thead th { font-size: .85rem; min-width: 0; }
.week-grid tbody th { white-space: nowrap; }
.week-name { display: block; }
.scores-cell { text-align: left !important; }
.scores-cell.empty { text-align: center !important; }
.score-line { display: flex; align-items: center; gap: 8px; font-size: .9rem; text-align: left; }
.score-line + .score-line { margin-top: 6px; }
.day-dots { display: inline-flex; gap: 3px; }
.day-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: .7rem;
}
.day-dot.on { background: var(--good); border-color: var(--good); color: #fff; font-weight: 700; }
.week-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.week-nav { display: flex; gap: 6px; flex: none; }
.week-nav .btn { padding: 0 14px; }
.report-title { font-size: 1rem; margin: 20px 0 6px; }
.lesson-grid tbody th { white-space: normal; }
.nowrap { white-space: nowrap; }
.report-actions { align-items: center; margin: 0 0 12px; }
.report-actions .hint { margin: 0; }
.missed-list { list-style: none; margin: 0; padding: 0; }
.missed-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.missed-list li:last-child { border-bottom: 0; }
.missed-he { font-size: 1.1rem; }
.missed-count { color: var(--muted); font-size: .85rem; white-space: nowrap; min-width: 5.5em; text-align: right; }

/* Share the site */
.share-card .actions { margin-top: 12px; }
.share-link { margin: 0; font-weight: 600; overflow-wrap: anywhere; user-select: all; }
.share-status { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.share-status:empty { display: none; }

/* Add to home screen */
.home-icon-card { display: flex; align-items: flex-start; gap: 20px; }
.home-icon { flex: none; width: 80px; height: 80px; border-radius: 18px; }
.home-icon-how > :first-child { margin-top: 0; }
.home-icon-how > :last-child { margin-bottom: 0; }
.home-icon-how .actions:first-child { margin-top: 8px; }
.home-icon-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.home-icon-done { margin: 8px 0 0; font-weight: 600; color: var(--good); }
.suggest-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.suggest-card .hint { margin: 0; }

/* Live class */
.live-dot { display: none; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: none; }
.live-dot.on { display: inline-block; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on { animation: none; } }
.live-start h2, .live-panel h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin: 0 0 8px; }
.live-start p { margin: 0 0 12px; }
.live-follow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 0 0; color: var(--muted); font-weight: 600;
}
.live-signed { text-align: center; margin: 4px 0 0; }
.live-panel { margin-top: 16px; }
.live-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.live-panel-head h2 { margin: 0; }
.live-people { margin: 8px 0 12px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.live-people li { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); font-size: .9rem; overflow-wrap: anywhere; }

/* Still teaching? The teacher's reminder every 30 minutes of a live class. */
.keep-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--warn);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}
.keep-dialog::backdrop { background: rgba(26, 32, 44, .45); }
.keep-dialog [hidden] { display: none !important; }
.keep-dialog h2 { margin: 0 0 8px; font-size: 1.25rem; }
.keep-dialog p { margin: 0 0 12px; }
.keep-dialog .keep-count {
  margin: 4px 0 12px;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.keep-dialog .hint { margin: 0; color: var(--muted); }
.keep-dialog .actions { margin-top: 16px; }

/* The teacher's meter of this month's video minutes (Live class and the Teacher page) */
.usage-card { margin: 16px 0; }
.usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.usage-head h2 { font-size: 1.1rem; margin: 0; }
.usage-pct { flex: none; color: var(--accent-dark); font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.usage-bar { height: 10px; margin: 8px 0 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; min-width: 3px; border-radius: 5px; background: var(--accent); }
.usage-text { margin: 0 0 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-card .hint { margin: 0; }
.usage-card.mid .usage-pct { color: var(--warn); }
.usage-card.mid .usage-bar span { background: var(--warn); }
.usage-card.high .usage-pct { color: var(--bad); }
.usage-card.high .usage-bar span { background: var(--bad); }

/* Live class video call */
.call-panel { margin-top: 16px; }
.call-panel[hidden], .call-panel [hidden] { display: none !important; }
.call-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.call-head h2 { font-size: 1.2rem; margin: 0; }
.call-show { margin-right: 0; }
.call-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.call-btn.is-off { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.call-status { margin: 8px 0 0; color: var(--muted); }
.call-status.error { color: var(--bad); }
/* Three across on a phone, so 11 people fit in four short rows */
.call-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 12px; }
@media (min-width: 600px) { .call-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.call-tile { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--text); }
.call-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.call-tile.is-local video { transform: scaleX(-1); } /* your own picture as in a mirror */
.call-tile.cam-off video { display: none; }
.call-initial {
  display: none;
  position: absolute;
  inset: 0 0 22px; /* centred above the name */
  margin: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-size: 1rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}
.call-tile.cam-off .call-initial { display: flex; }
.call-label {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .8rem;
}
.call-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-muted { flex: none; font-size: .75rem; }
.call-others { margin: 8px 0 0; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.call-note { margin: 8px 0 0; }

/* Live quiz game */
.game-launch h2 { font-size: 1.2rem; margin: 0 0 8px; }
.game-launch p { margin: 0 0 12px; }
.game-options { display: flex; flex-wrap: wrap; gap: 0 20px; }
.game-options .field { margin: 4px 0 16px; }
.game-options select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
}
.game-card { text-align: center; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.game-step { color: var(--muted); font-weight: 600; }
.game-count {
  min-width: 48px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.game-count.over { background: var(--bad); }
.game-time { height: 8px; margin-bottom: 16px; border-radius: 4px; background: var(--border); overflow: hidden; }
.game-time span { display: block; height: 100%; background: var(--accent); transform-origin: left; animation: game-time linear forwards; }
.game-time.done span { transform: scaleX(0); animation: none; }
@keyframes game-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.game-ready { margin: 24px 0 0; font-size: 1.8rem; font-weight: 800; color: var(--accent-dark); }
.game-ready-count {
  margin: 8px 0;
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.game-ready-hint { margin-bottom: 24px; }
.game-prompt { margin: 8px 0 20px; }
.game-q { margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.game-meaning { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.game-he { margin: 0; font-size: 2.4rem; font-weight: 700; line-height: 1.4; }
.game-tr { margin: 0 0 6px; color: var(--muted); font-style: italic; }
.game-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 84px;
  padding: 12px 48px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
}
.game-tile:not(:disabled):hover { transform: translateY(-2px); }
.game-tile:not(:disabled):active { transform: scale(.98); }
.game-tile:disabled { cursor: default; }
.game-tile:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.game-c1 { background: var(--game-1); }
.game-c2 { background: var(--game-2); }
.game-c3 { background: var(--game-3); }
.game-c4 { background: var(--game-4); }
.game-c5 { background: var(--game-gold); }
.game-tile [lang="he"] { font-size: 1.6rem; line-height: 1.35; }
.game-tile-tr { font-size: .9rem; font-weight: 400; font-style: italic; opacity: .9; }
.game-mark {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  font-size: 1.1rem;
  line-height: 32px;
}
.game-tile.picked { border-color: var(--text); box-shadow: 0 0 0 3px var(--surface) inset; }
.game-tile.dim { opacity: .35; }
.game-tile.right { border-color: var(--text); box-shadow: 0 0 0 3px var(--surface) inset; transform: scale(1.02); }
.game-tile.wrong { opacity: .6; text-decoration: line-through; }
.game-tick, .game-tile-count {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 32px;
}
/* The right answer's tick sits on the tile's corner, clear of a long answer. */
.game-tick {
  top: -12px;
  left: auto;
  right: -10px;
  transform: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid var(--surface);
  background: var(--good);
  color: #fff;
  font-size: 1.1rem;
  line-height: 30px;
}
.game-hint { margin: 12px 0 0; }
.game-answer { margin: 16px 0 0; font-weight: 600; }
.game-answer [lang="he"] { font-size: 1.3rem; }
.game-answer .tr { font-style: italic; font-weight: 400; color: var(--muted); }
.game-answer .speak-btn { vertical-align: middle; }
.game-status { margin: 16px 0 0; font-weight: 600; color: var(--muted); }
.game-status.error { color: var(--bad); }
.game-actions { justify-content: center; margin-top: 12px; }
.game-result { margin: 16px 0 0; padding: 12px; border-radius: var(--radius-sm); }
.game-result.good { background: var(--good-soft); color: var(--good); }
.game-result.bad { background: var(--bad-soft); color: var(--bad); }
.game-result p { margin: 0; }
.game-result-head { font-size: 1.4rem; font-weight: 800; }
.game-result-place { margin: 4px 0 0; color: var(--text); font-weight: 600; }
.game-board-title { margin: 20px 0 8px; font-size: 1.1rem; }
.game-board { max-width: 420px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 6px; text-align: left; }
.game-board li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--bg); }
.game-board li.me { background: var(--accent-soft); font-weight: 700; }
.game-board-place { flex: none; width: 24px; font-weight: 800; color: var(--accent-dark); }
.game-board-name { flex: 1; overflow-wrap: anywhere; }
.game-board-points { flex: none; font-variant-numeric: tabular-nums; }
.game-final-title { margin: 0 0 16px; font-size: 1.5rem; }
.game-podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; max-width: 480px; margin: 0 auto 16px; }
.game-stand { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.game-medal { font-size: 2rem; line-height: 1.2; }
.game-stand-name { max-width: 100%; font-weight: 700; overflow-wrap: anywhere; }
.game-stand-points { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.game-stand-block {
  width: 100%;
  margin-top: 4px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}
.game-stand.place-1 .game-stand-block { height: 110px; background: var(--game-gold); }
.game-stand.place-2 .game-stand-block { height: 80px; }
.game-stand.place-3 .game-stand-block { height: 56px; background: var(--accent-dark); }
.game-final .game-board { margin-top: 8px; }
.game-final .hint { margin: 16px 0 0; }
.confetti { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  from { transform: translateY(0) rotate(var(--turn)); }
  to { transform: translateY(110vh) rotate(calc(var(--turn) + 600deg)); }
}
@media (max-width: 560px) {
  .game-tiles { gap: 8px; }
  .game-tile { min-height: 72px; padding: 30px 8px 8px; font-size: 1rem; }
  .game-tile [lang="he"] { font-size: 1.3rem; }
  .game-mark, .game-tile-count { top: 6px; transform: none; width: 24px; height: 24px; min-width: 24px; line-height: 24px; font-size: .85rem; }
  .game-mark { right: 6px; }
  .game-tile-count { left: 6px; padding: 0 4px; }
  .game-he { font-size: 2rem; }
  .game-meaning { font-size: 1.3rem; }
  .game-tiles.meanings .game-tile { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .game-tile { transition: none; }
  .game-time { visibility: hidden; } /* the number still counts down */
}
.teacher-signin { margin-top: 24px; color: var(--muted); }
.teacher-signin summary { cursor: pointer; font-size: .9rem; }
.teacher-signin form { margin-top: 8px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-dark); text-decoration: underline; cursor: pointer; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.study-toolbar { margin-bottom: 16px; column-gap: 24px; }
.study-toolbar .toggle { margin-right: 0; } /* two checkboxes sit side by side */
.toggle { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; cursor: pointer; }
.toggle input { width: 18px; height: 18px; }

/* Printable page: an A4 sheet at 96 dpi, scaled down to fit narrow screens */
.page-frame {
  max-width: 794px;
  margin: 0 auto;
  overflow: hidden;
}
.page-frame + .page-frame { margin-top: 20px; }
.page {
  width: 794px;
  height: 1123px;
  padding: 34px;
  background: #fff;
  color: #1a202c;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 6px 20px rgba(0, 0, 0, .08);
  transform-origin: top left;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sheet { font-family: var(--font-sheet); font-size: 14px; }
.sheet-title { text-align: center; font-size: 1.7em; margin: 0; color: #1a365d; }
.sheet-subtitle { text-align: center; font-style: italic; margin: .1em 0 .5em; color: #4a5568; }
.sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sheet th, .sheet td {
  border: 1px solid #a0aec0;
  padding: .14em .45em;
  vertical-align: middle;
  text-align: left;
  line-height: 1.22;
}
.sheet thead th { background: #3182ce; color: #fff; }
.sheet th.he, .sheet td.he { text-align: right; }
.sheet td.he { font-family: var(--font-he); font-size: 1.12em; line-height: 1.15; }
.sheet td.tr { font-style: italic; }
.sheet tr.section td {
  background: #ebf8ff;
  color: #2b6cb0;
  font-weight: 700;
  text-align: center;
}
.sheet tr.explain td {
  font-size: .86em;
  line-height: 1.3;
  color: #2d3748;
  white-space: pre-line;
}
/* A form moves to its own line when it doesn't fit beside the other one,
   and wraps inside the cell only when it is longer than the cell. */
.sheet .form { display: inline-block; max-width: 100%; }
.sheet td.he { position: relative; }
.sheet .speakable { cursor: pointer; }
.sheet .speakable:hover { color: var(--accent-dark); }

/* Listen buttons */
.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-dark);
  cursor: pointer;
  vertical-align: middle;
}
.speak-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.speak-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.speak-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.speak-btn svg .fill { fill: currentColor; }
.speak-btn.big { width: 52px; height: 52px; padding: 11px; margin-top: 6px; }
.sheet-speak {
  position: absolute;
  top: 50%;
  right: -29px;
  width: 22px;
  height: 22px;
  padding: 3px;
  margin-top: -11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(480px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  z-index: 10;
}
.sheet .sep { color: #718096; }
.sheet-notes { margin: .8em 0 0; font-size: .9em; color: #2d3748; }
/* In em, so it shrinks with the text when the sheet is fitted to the page. */
.sheet-picture { display: block; width: 46em; max-width: 100%; height: auto; margin: .9em auto 0; }
.sheet-notes a { color: var(--accent-dark); overflow-wrap: anywhere; }

/* Word by word */
.word-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 52vh;
  text-align: center;
  touch-action: pan-y;
}
.word-card.card { padding-top: 14px; }
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.card-section {
  margin: 0;
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.card-explain {
  margin: 16px 0 0;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: .95rem;
  line-height: 1.5;
  text-align: left;
  white-space: pre-line;
}
.card-forms { display: grid; gap: 20px; width: 100%; }
.card-forms.two { grid-template-columns: 1fr 1fr; }
.card-form { display: grid; gap: 4px; justify-items: center; }
.card-gender {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .8rem;
  font-weight: 600;
}
.card-he { margin: 0; font-size: 2.6rem; line-height: 1.3; font-weight: 600; }
.card-forms.two .card-he { font-size: 2rem; }
.card-tr { margin: 0; font-size: 1.5rem; font-style: italic; color: var(--muted); }
.card-en {
  margin: 0 0 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  font-size: 1.7rem;
  line-height: 1.3;
  font-weight: 600;
}
.card-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.card-nav .btn { min-height: 52px; }
.card-nav .btn:disabled { opacity: .45; cursor: default; }
.card-count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.card-hint { text-align: center; }

/* Quiz */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.quiz-progress { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 20px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); }
.prompt { font-size: 1.4rem; font-weight: 700; margin: 0 0 20px; }
.options { display: grid; gap: 10px; }
.option, .match-item {
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}
.option { text-align: right; display: flex; flex-wrap: wrap; align-items: baseline; align-content: center; gap: 2px 16px; }
/* The transliteration beside a Hebrew answer: on the left, or under the Hebrew when there's no room. */
.opt-tr { font-family: var(--font-ui); font-size: .75em; font-style: italic; color: var(--muted); }
.option .opt-tr { margin-right: auto; }
.match-item.he .opt-tr { display: block; margin-top: 2px; }
.option-row { position: relative; }
/* The listen button takes the left of the row, wide enough that a tap just
   beside the speaker plays the word instead of answering. The line shows
   where it ends. */
.option-row .option { padding-left: 108px; }
.option-speak {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: 92px;
  height: auto;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: calc(var(--radius-sm) - 2px) 0 0 calc(var(--radius-sm) - 2px);
  background: transparent;
}
.option-speak svg { width: 36px; height: 36px; padding: 6px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); }
.option-speak:hover { background: var(--accent-soft); }
.option-speak:hover svg { border-color: var(--accent); }
.option-speak:focus-visible { outline-offset: -3px; }
.option:hover:not(:disabled), .match-item:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled, .match-item:disabled { cursor: default; }
.option.correct, .match-item.matched { border-color: var(--good); background: var(--good-soft); color: var(--text); }
.option.wrong, .match-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.faded { opacity: .55; }
.match-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.feedback { margin: 16px 0 0; font-weight: 600; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.feedback .tr { font-style: italic; font-weight: 400; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
/* Equal rows, so the English buttons line up with the taller Hebrew ones (Hebrew and transliteration). */
.match-col { display: grid; gap: 10px; grid-auto-rows: 1fr; }
.match-item.en { font-size: 1rem; text-align: left; }
.match-item.he { text-align: right; }

.field { display: grid; gap: 6px; margin: 16px 0; max-width: 360px; }
.field input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.score { font-size: 2.6rem; font-weight: 800; margin: 0; color: var(--accent-dark); }
.missed { margin-top: 20px; }
.missed h3 { font-size: 1rem; margin: 0 0 8px; }
.missed ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.missed li { padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.missed .he { font-size: 1.2rem; display: block; text-align: right; }
.missed .tr { font-style: italic; color: var(--muted); }
.send-status { color: var(--muted); font-size: .9rem; margin-top: 12px; }
.send-status.bad { color: var(--bad); }


/* Teacher dashboard */
.muted { color: var(--muted); }
.dash-toolbar { margin-bottom: 16px; }
.dash-status { margin: 0 auto 0 0; color: var(--muted); font-size: .9rem; }
.dash-card { margin-bottom: 16px; }
.dash-card h2 { font-size: 1.1rem; margin: 0 0 4px; }
.dash-card .hint { margin: 0 0 12px; }
.grid-scroll { overflow-x: auto; }
.score-grid { border-collapse: collapse; min-width: 100%; }
.score-grid th, .score-grid td { padding: 6px; border-bottom: 1px solid var(--border); text-align: center; }
.score-grid thead th { vertical-align: bottom; font-weight: 600; min-width: 110px; }
.score-grid th:first-child { text-align: left; min-width: 120px; position: sticky; left: 0; background: var(--surface); }
.score-grid tbody th { font-weight: 600; }
.col-title { display: block; font-size: .85rem; }
.score-grid td.empty { color: var(--muted); }
/* Teacher page: championship board names */
.board-grid thead th, .board-grid th:first-child { min-width: 0; }
.board-grid td:last-child { text-align: right; }
.board-toggle { min-height: 36px; padding: 0 12px; }
.board-hidden th, .board-hidden td:not(:last-child) { color: var(--muted); }
.board-tag {
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}
.cell {
  display: grid;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}
.cell-score { font-weight: 700; }
.cell-tries { font-size: .75rem; color: var(--muted); }
.cell.good, .score-pill.good { background: var(--good-soft); color: var(--good); }
.cell.ok, .score-pill.ok { background: var(--warn-soft); color: var(--warn); }
.cell.low, .score-pill.low { background: var(--bad-soft); color: var(--bad); }
.cell.selected { border-color: var(--accent); }
.cell:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.score-pill { padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.attempts, .recent { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.attempts li { padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.attempt-head { display: flex; gap: 12px; align-items: center; }
.attempt-missed { margin: 6px 0 0; font-size: .9rem; }
.recent li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.recent li:last-child { border-bottom: 0; }
.recent-name { font-weight: 600; }
.recent .muted { grid-column: 1; font-size: .9rem; }
.recent .score-pill { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.pin-changes li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.country-list { list-style: none; margin: 0; padding: 0; max-width: 360px; }
.country-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.country-list li:last-child { border-bottom: 0; }
.country-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.signin-note { margin: 12px 0 0; }
.pin-changes .muted { margin-left: auto; }
.activity-filters { margin-bottom: 4px; }
.activity-filter { font-family: inherit; cursor: pointer; }
.activity-tag {
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 1px;
}
.activity-tag.new { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.activity-country { margin-left: 8px; color: var(--muted); font-size: .85rem; font-weight: 400; white-space: nowrap; }
/* Country flags on the Teacher page. Windows has no flag emoji, so they come
   from this font; the browser downloads it (78 KB) only when a flag is shown. */
@font-face {
  font-family: "Twemoji Country Flags";
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}
.flag { margin-right: 4px; font-family: "Twemoji Country Flags", var(--font-ui); }
.stat-button { border: 1px solid transparent; font: inherit; color: inherit; cursor: pointer; }
.stat-button:hover { border-color: var(--accent); }
.stat-button.active { border-color: var(--accent); background: var(--accent-soft); }
.stat-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.activity-names { margin: -6px 0 16px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm); }
.activity-names-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.name-list { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.name-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.name-list .activity-country { margin-left: 0; }
.invite-list { list-style: none; margin: 0; padding: 0; }
.invite-list > li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.invite-list > li:last-child { border-bottom: 0; }
.invite-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; }
.invite-count { margin-left: auto; padding-left: 12px; font-size: .9rem; }
.invite-friends { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.invite-friends li { white-space: nowrap; }
.invite-friends .activity-tag { margin-left: 6px; }
.activity-list time { white-space: nowrap; }
.activity-list + .btn { margin-top: 10px; }
.pin-history { margin: 4px 0 12px; }
.pin-history summary { cursor: pointer; font-weight: 600; }
.pin-changes + .btn { margin-top: 10px; }

@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .card { padding: 18px 14px; }
  .prompt { font-size: 1.2rem; }
  .option, .match-item { font-size: 1.15rem; }
  .match-item.en { font-size: .9rem; }
  .mainnav-inner { padding: 0; gap: 0; }
  /* Five items have to fit across a phone. */
  .mainnav-link { flex: 1 1 auto; padding: 12px 4px 9px; font-size: .88rem; text-align: center; }
  .topnav-out { padding: 2px 8px; }
  .lang-select { padding: 2px 4px; }
  .stats { gap: 6px; grid-template-columns: repeat(2, 1fr); }
  .week-head { flex-wrap: wrap; }
  .missed-list li { grid-template-columns: 1fr auto; }
  .missed-count { grid-column: 1 / -1; text-align: left; }
  .stat { padding: 10px 6px; }
  .stat-value { font-size: 1.3rem; }
  .day-dot { width: 18px; height: 18px; font-size: .6rem; }
  /* Word by word: everything down to the Next button fits on a phone screen. */
  main { padding-top: 14px; }
  .lesson-head h1 { margin-bottom: 10px; }
  .subtabs { gap: 6px; margin-bottom: 12px; }
  .subtab { padding: 5px 11px; font-size: .88rem; }
  .subtab-picker { padding-right: 7px; gap: 3px; }
  .study-lesson { margin-bottom: 8px; font-size: 1rem; }
  .subtab-caret { width: 17px; height: 17px; }
  .study-toolbar { margin-bottom: 10px; }
  .progress-bar { margin-bottom: 12px; }
  .word-card { min-height: 0; gap: 8px; }
  .word-card.card { padding-top: 12px; }
  .card-body { gap: 8px; }
  .card-he { font-size: 2.2rem; }
  /* Male and female side by side, so both fit without scrolling. */
  .card-forms.two { gap: 10px; }
  .card-forms.two .card-he { font-size: 1.5rem; }
  .card-forms.two .card-tr { font-size: 1.05rem; }
  .card-tr { font-size: 1.35rem; }
  .card-en { font-size: 1.5rem; margin-bottom: 4px; padding-bottom: 10px; }
  .card-body.long .card-en { font-size: 1.2rem; }
  .card-body.long .card-he { font-size: 1.8rem; }
  .card-body.long .card-tr { font-size: 1.15rem; }
  .card-body.long .card-forms.two .card-he { font-size: 1.3rem; }
  .card-body.long .card-forms.two .card-tr { font-size: .95rem; }
  .speak-btn.big { width: 46px; height: 46px; padding: 10px; margin-top: 2px; }
  .card-nav { gap: 8px; margin-top: 12px; }
  .card-nav .btn { padding: 0 12px; min-height: 48px; }
  .card-hint { display: none; }
}

/* Printing: only the lesson page, exactly one A4 sheet */
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .no-print, .topbar { display: none !important; }
  main { padding: 0; max-width: none; }
  .page-frame { max-width: none; height: auto !important; overflow: visible; }
  .page-frame + .page-frame { margin-top: 0; break-before: page; }
  .page {
    transform: none !important;
    box-shadow: none;
    width: 210mm;
    height: 296mm;
    padding: 9mm;
  }
}

/* A progress report saved as a PDF: only the report, on pages with margins
   (app.js adds the page margin while it prints). */
#print-area { display: none; }
@media print {
  html.print-report main { display: none !important; }
  html.print-report #print-area { display: block; font-size: 10.5pt; }
  #print-area * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head {
    display: flex;
    justify-content: space-between;
    padding-bottom: 6px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--accent);
    color: var(--muted);
    font-size: 9.5pt;
  }
  .print-head strong { color: var(--accent-dark); }
  #print-area h1 { font-size: 18pt; margin: 0 0 2px; }
  #print-area .lede { margin: 0 0 14px; }
  #print-area .report-title { font-size: 12pt; margin: 18px 0 6px; break-after: avoid; }
  #print-area .grid-scroll { overflow: visible; }
  #print-area .score-grid { width: 100%; }
  #print-area .score-grid th:first-child { position: static; background: none; }
  #print-area .score-grid thead th { min-width: 0; }
  #print-area tr, #print-area li, #print-area .stat { break-inside: avoid; }
  #print-area .stats { grid-template-columns: repeat(4, 1fr); }
  #print-area .stat { border: 1px solid var(--border); }
  #print-area .cell { min-height: 0; padding: 3px 6px; }
}

/* The teacher's Lessons page: the weekly plan */
.plan-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 4px 0 8px; }
.plan-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.plan-check select { font: inherit; font-weight: 400; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.plan-count { color: var(--muted); font-size: .9rem; }
.plan-heading { font-size: 1.15rem; margin: 22px 0 8px; }
.plan-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.plan-table th { text-align: left; font-size: .85rem; color: var(--muted); background: var(--bg); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.plan-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.plan-table tr:last-child td { border-bottom: 0; }
.plan-date { white-space: nowrap; font-weight: 600; }
.plan-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.plan-lesson { font-weight: 600; color: var(--accent-dark); }
.plan-theme { font-weight: 600; }
.plan-note { color: var(--muted); font-size: .85rem; }
.plan-holiday { font-size: .85rem; color: var(--accent-dark); }
.plan-missing { font-size: .8rem; color: var(--muted); }
.plan-missing.soon { color: var(--bad); font-weight: 600; }
.plan-status { font-size: .8rem; font-weight: 600; border-radius: var(--radius-sm); padding: 1px 8px; white-space: nowrap; }
.plan-status.approved { color: var(--good); background: var(--good-soft); }
.plan-status.awaiting { color: var(--warn); background: var(--warn-soft); }
.plan-status.before { color: var(--muted); background: var(--bg); }
.plan-btn { padding: 2px 10px; font-size: .85rem; }
@media (max-width: 600px) {
  .plan-date { white-space: normal; }
  .plan-table td, .plan-table th { padding: 6px; }
}

/* The Advanced Quiz in Self study: the live game, played alone */
.quiz-pick.advanced { border-color: var(--game-3); }
.quiz-pick.advanced .quiz-pick-name { color: var(--game-3); }
.game-points { font-weight: 700; color: var(--accent-dark); }
.game-points.big { margin: -8px 0 12px; font-size: 1.2rem; }
/* What a right answer is worth now, under the time bar, counting down from 1,000 */
.game-worth { margin: -10px 0 6px; text-align: right; font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }

/* Delete my account (My progress) and the Privacy policy page */
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
.delete-account { margin-top: 32px; color: var(--muted); }
.delete-account summary { cursor: pointer; font-size: .9rem; }
.delete-account[open] { color: var(--text); }
.delete-account form { margin-top: 8px; max-width: 320px; }
.privacy-card { margin: 16px 0; }
.privacy-card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.privacy-card ul { margin: 0; padding-left: 20px; }
.privacy-card li + li { margin-top: 6px; }
