/* MathCat — practice landing + printable worksheets */

:root {
  --bg: #0a1628;
  --bg-2: #0d1f3c;

  /* Surfaces: page < panel < card, so nesting is always visible */
  --panel: #0e2242;
  --panel-border: rgba(20, 255, 236, 0.16);
  --card: #16325c;
  --card-border: rgba(20, 255, 236, 0.32);

  --cyan: #14ffec;
  --cyan-dark: #0d7377;
  --orange: #ff8c00;
  --gold: #ffd700;

  /* Long-form reading needs more lift than the app's short UI labels */
  --text-primary: #ffffff;
  --text-secondary: #cbd9e8;
  --text-muted: #9fb3c8;
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --dim: var(--text-muted);

  --border: rgba(20, 255, 236, 0.22);
  --border-hover: rgba(20, 255, 236, 0.65);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', 'Noto Sans TC', sans-serif;
  --font-zh: 'Noto Sans TC', 'Rajdhani', sans-serif;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.practice-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

/* Ambient background */
.pr-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 255, 236, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 255, 236, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

.pr-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.pr-orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: var(--cyan-dark);
}

.pr-orb-2 {
  width: 340px;
  height: 340px;
  bottom: 8%;
  right: -110px;
  background: var(--orange);
  opacity: 0.22;
}

/* Top bar */
.pr-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(20, 255, 236, 0.14);
}

.pr-topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.6rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.pr-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.pr-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pr-brand-cat svg {
  width: 30px;
  height: 30px;
  display: block;
}

.pr-brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.pr-brand-text span {
  color: var(--cyan);
}

.pr-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Back button — always visible, including on mobile */
.pr-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(20, 255, 236, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  transition: 0.2s ease;
}

.pr-back:hover {
  background: rgba(20, 255, 236, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
}

.pr-back-arrow {
  font-size: 1.05em;
  line-height: 1;
  color: var(--cyan);
}

.pr-back-label {
  white-space: nowrap;
}

.pr-join {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cyan);
  border: 1px solid rgba(20, 255, 236, 0.4);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  transition: 0.2s ease;
}

.pr-join:hover {
  background: rgba(20, 255, 236, 0.1);
  border-color: var(--cyan);
}

/* Signed-in parents (html.mc-signed-in): no signup pitch, just a way back in. */
.pr-join-member {
  display: none;
}

.mc-signed-in .pr-join-guest {
  display: none;
}

.mc-signed-in .pr-join-member {
  display: inline;
}

.mc-signed-in .pr-joinstrip,
.mc-signed-in .worksheet-mid-cta {
  display: none !important;
}

.pr-topbtn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  background: transparent;
  border: 1px solid rgba(20, 255, 236, 0.4);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.pr-topbtn:hover {
  background: rgba(20, 255, 236, 0.1);
}

.pr-topbtn--solid {
  background: var(--cyan);
  color: #06121f;
  border-color: var(--cyan);
}

.pr-topbtn--solid:hover {
  box-shadow: 0 0 18px rgba(20, 255, 236, 0.45);
  background: var(--cyan);
}

/* Layout */
.pr-main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 3rem;
}

.pr-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.75rem;
  align-items: start;
}

.pr-hero {
  padding-top: 0.25rem;
}

/* The worksheet column is the primary action — keep it visually louder */
.pr-section--sheets {
  margin-top: 0;
  background: linear-gradient(160deg, rgba(13, 115, 119, 0.2), var(--panel) 55%);
  border-color: rgba(20, 255, 236, 0.34);
}

/* Hero */
.pr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
}

.chip {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 255, 236, 0.08);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-zh);
}

.chip-grade {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.28), rgba(118, 75, 162, 0.28));
  border-color: rgba(148, 130, 238, 0.5);
  color: #dcd6ff;
}

.chip-edb {
  background: rgba(255, 140, 0, 0.12);
  border-color: rgba(255, 140, 0, 0.4);
  color: #ffc478;
}

.pr-h1 {
  margin: 0 0 0.7rem;
  line-height: 1.15;
}

.pr-h1 .t-zh {
  display: block;
  font-family: var(--font-zh);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  color: var(--text-primary);
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pr-h1 .t-en {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

.pr-lead {
  margin: 0 0 1.15rem;
  max-width: 46ch;
  font-size: 1.02rem;
}

.l-zh {
  display: block;
  font-family: var(--font-zh);
  color: var(--text-primary);
}

.l-en {
  display: block;
  color: var(--text-secondary);
  font-size: 0.93em;
  margin-top: 0.2rem;
}

.pr-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  font-family: var(--font-zh);
}

.pr-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(20, 255, 236, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
}

/* Worksheet cards */
.pr-sheets {
  display: grid;
  gap: 1rem;
}

.sheet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 1.25rem 1.3rem 1.35rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sheet-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), rgba(20, 255, 236, 0.15));
}

.sheet-card--hard::before {
  background: linear-gradient(90deg, var(--orange), rgba(255, 140, 0, 0.15));
}

.sheet-card:hover {
  transform: translateY(-3px);
  background: #1b3c6c;
  border-color: var(--cyan);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(20, 255, 236, 0.12);
}

.sheet-card--hard:hover {
  border-color: var(--orange);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(255, 140, 0, 0.14);
}

.sheet-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), #0aa89b);
  color: #06121f;
  font-family: var(--font-zh);
}

.sheet-badge--hard {
  background: linear-gradient(135deg, var(--orange), #ff6600);
  color: #1a0f00;
}

.sheet-icon {
  position: absolute;
  top: 1.05rem;
  right: 1.2rem;
  font-size: 1.6rem;
  opacity: 0.9;
}

.sheet-title {
  margin: 0.6rem 0 0.3rem;
  font-family: var(--font-zh);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-title span {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.sheet-meta {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: var(--font-zh);
}

/* Looks and behaves like the button it is */
.sheet-go {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.45rem;
  margin-top: auto;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  font-family: var(--font-zh);
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--cyan), #0aa89b);
  color: #04121d;
  box-shadow: 0 4px 14px rgba(20, 255, 236, 0.22);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sheet-card--hard .sheet-go {
  background: linear-gradient(135deg, var(--orange), #ff6600);
  color: #1a0f00;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.26);
}

.sheet-card:hover .sheet-go {
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(20, 255, 236, 0.38);
}

.sheet-card--hard:hover .sheet-go {
  box-shadow: 0 7px 20px rgba(255, 140, 0, 0.4);
}

.sheet-card--soon {
  cursor: default;
  pointer-events: none;
  background: rgba(16, 34, 66, 0.55);
  border-style: dashed;
  border-color: rgba(159, 179, 200, 0.3);
  box-shadow: none;
}

.sheet-card--soon .sheet-title,
.sheet-card--soon .sheet-title span,
.sheet-card--soon .sheet-meta {
  color: var(--text-muted);
}

.sheet-card--soon .sheet-badge {
  background: rgba(159, 179, 200, 0.2);
  color: var(--text-secondary);
}

.sheet-card--soon::before {
  background: rgba(159, 179, 200, 0.28);
}

/* Sections — each one is a panel so the page reads as blocks, not a stream */
.pr-section {
  margin-top: 1.75rem;
  padding: 1.3rem 1.4rem 1.45rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.pr-h2 {
  font-family: var(--font-zh);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.15rem;
  padding: 0 0 0.75rem 0.9rem;
  color: var(--text-primary);
  border-left: 4px solid var(--cyan);
  border-bottom: 1px solid rgba(20, 255, 236, 0.18);
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pr-h2 span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* EDB curriculum note */
.pr-note {
  margin: 0 0 1.1rem;
  max-width: 72ch;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Unit chips */
.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.unit-chip {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-zh);
  font-size: 0.92rem;
}

.unit-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.unit-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.unit-code {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: #06121f;
  background: var(--cyan);
  border-radius: 5px;
  padding: 0.14rem 0.42rem;
}

.unit-chip--strand {
  border-color: rgba(255, 140, 0, 0.4);
}

.unit-chip--strand .unit-label {
  color: #ffc478;
}

.unit-name-zh {
  color: var(--text-primary);
  font-weight: 600;
}

.unit-name-en {
  color: var(--text-secondary);
  font-size: 0.85em;
}

/* Compact examples */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.9rem;
}

.ex-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.ex-tier {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  margin-bottom: 0.55rem;
  font-family: var(--font-zh);
}

.ex-q-zh {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ex-q-en {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.ex-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
}

.ex-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-family: var(--font-zh);
  font-size: 0.88rem;
  padding: 0.25rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

.ex-chip-en {
  font-family: var(--font-body);
  font-size: 0.85em;
  color: var(--text-secondary);
}

.ex-chip.is-correct {
  background: rgba(20, 255, 236, 0.14);
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
}

.ex-chip.is-correct .ex-chip-en {
  color: rgba(20, 255, 236, 0.85);
}

.ex-tick {
  margin-left: 0.1rem;
}

.ex-hint {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(20, 255, 236, 0.18);
  font-size: 0.88rem;
}

.ex-hint .opt-zh {
  display: block;
  font-family: var(--font-zh);
  color: var(--text-primary);
}

.ex-hint .opt-en {
  display: block;
  color: var(--text-secondary);
  font-size: 0.92em;
  margin-top: 0.15rem;
}

/* Subtle join strip */
.pr-joinstrip {
  margin-top: 1.75rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(20, 255, 236, 0.3);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.34), rgba(16, 34, 66, 0.85));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
}

.pr-joinstrip p {
  margin: 0;
  font-size: 0.98rem;
  max-width: 56ch;
}

.pr-joinstrip-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.pr-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.pr-btn-ghost {
  color: var(--cyan);
  border-color: rgba(20, 255, 236, 0.45);
  background: transparent;
}

.pr-btn-ghost:hover {
  background: rgba(20, 255, 236, 0.1);
  border-color: var(--cyan);
}

.pr-btn-play {
  background: linear-gradient(135deg, var(--orange), #ff6600);
  color: #1a0f00;
}

.pr-btn-play:hover {
  box-shadow: 0 8px 22px rgba(255, 140, 0, 0.35);
}

.pr-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

/* ---------- Printable worksheet ---------- */
.worksheet-page .pr-main {
  max-width: 820px;
}

.worksheet-sheet {
  background: #fff;
  color: #111;
  border-radius: 10px;
  padding: 1.5rem 1.7rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.sheet-header {
  border-bottom: 2px solid #0d7377;
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
}

.sheet-brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sheet-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #0d7377;
}

.sheet-tier {
  font-family: var(--font-zh);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #0d7377;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

.worksheet-sheet .sheet-title {
  margin: 0.45rem 0 0.35rem;
}

.worksheet-sheet .sheet-title .title-zh {
  display: block;
  font-family: var(--font-zh);
  font-size: 1.4rem;
  font-weight: 700;
  color: #111;
}

.worksheet-sheet .sheet-title .title-en {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-top: 0.1rem;
}

.worksheet-sheet .sheet-meta {
  margin: 0.3rem 0;
  font-family: var(--font-zh);
  font-size: 0.82rem;
  color: #555;
}

.sheet-meta--edb {
  font-size: 0.76rem !important;
  color: #0d7377 !important;
  border-left: 3px solid #0d7377;
  padding-left: 0.5rem;
}

.sheet-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 0.6rem;
  font-family: var(--font-zh);
  font-size: 0.9rem;
  color: #222;
}

.sheet-instructions {
  margin: 0.55rem 0 0;
  font-family: var(--font-zh);
  font-size: 0.88rem;
  font-weight: 600;
  color: #0d7377;
}

.worksheet-question {
  display: grid;
  grid-template-columns: 1.9rem 1fr;
  gap: 0.15rem 0.4rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #ececec;
  break-inside: avoid;
  page-break-inside: avoid;
}

.q-num {
  margin: 0;
  font-weight: 700;
  color: #0d7377;
}

.q-body {
  min-width: 0;
}

.q-zh {
  margin: 0;
  font-family: var(--font-zh);
  font-weight: 600;
  color: #111;
}

.q-en {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  color: #666;
}

.q-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.q-options li {
  font-family: var(--font-zh);
  font-size: 0.92rem;
  min-width: 6.5rem;
}

.opt-letter {
  font-weight: 700;
  margin-right: 0.2rem;
  color: #0d7377;
}

.q-options .opt-en {
  color: #777;
  font-size: 0.85em;
  margin-left: 0.25rem;
}

/* Answer key */
.answers-list {
  columns: 2;
  column-gap: 2rem;
}

.answer-row {
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.answer-line {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 0.95rem;
}

.answer-num {
  font-weight: 700;
  color: #555;
  margin-right: 0.25rem;
}

.answer-key {
  display: inline-block;
  min-width: 1.3rem;
  text-align: center;
  font-weight: 800;
  color: #fff;
  background: #0d7377;
  border-radius: 4px;
  padding: 0 0.25rem;
  margin-right: 0.35rem;
}

.answer-val {
  font-weight: 600;
  color: #111;
}

.answer-hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #666;
}

.answer-hint .opt-zh {
  display: block;
  font-family: var(--font-zh);
}

.answer-hint .opt-en {
  display: block;
  color: #8a8a8a;
}

.sheet-footer {
  margin-top: 0.9rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  font-family: var(--font-zh);
  font-size: 0.75rem;
  color: #777;
  text-align: center;
}

.worksheet-mid-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(15, 36, 68, 0.7);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.worksheet-mid-cta .l-zh,
.worksheet-mid-cta .l-en {
  display: inline;
}

.page-break-before {
  break-before: page;
  page-break-before: always;
}

/* Responsive */
@media (max-width: 860px) {
  .pr-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .pr-section--sheets {
    margin-top: 0.25rem;
  }
}

@media (max-width: 560px) {
  .pr-topbar-inner {
    padding: 0.55rem 0.85rem;
  }

  /* Hide the wordmark, not the back button, when space is tight */
  .pr-brand-text {
    display: none;
  }

  .pr-main {
    padding: 1.1rem 0.85rem 2.5rem;
  }

  .worksheet-sheet {
    padding: 1.1rem 1rem;
  }

  .answers-list {
    columns: 1;
  }

  .pr-joinstrip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print */
@media print {
  body.practice-page {
    background: #fff;
    color: #000;
  }

  .screen-only,
  .pr-bg,
  .pr-topbar,
  .worksheet-mid-cta,
  .pr-footer {
    display: none !important;
  }

  .pr-main,
  .worksheet-page .pr-main {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .worksheet-sheet {
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0.45in 0.55in;
  }

  .worksheet-question {
    font-size: 11pt;
    padding: 0.42rem 0;
  }

  .q-options li {
    font-size: 10.5pt;
  }

  body.print-questions-only .worksheet-answers {
    display: none !important;
  }
}
