/* Mathski shared layout: background, banner, footer, home, tickets, info pages */

body { background: #F3F7FC; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #F3F7FC url("img/bg_desktop.webp") center bottom / cover no-repeat;
}
@media (max-width: 640px) {
  body::before { background-image: url("img/bg_phone.webp"); }
}

/* ─── Banner ─── */
.msk-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(28,28,30,0.1);
}
.msk-banner-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}
.msk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1C1C1E;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.msk-brand img { width: 44px; height: auto; display: block; }
.msk-brand span { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.6rem; color: #1C1C1E; }
.msk-brand span b { color: #007AFF; font-weight: 800; }
.msk-nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; }
.msk-nav a, .msk-nav button {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #3C3C43;
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 14px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.msk-nav a:hover, .msk-nav button:hover { color: #007AFF; }
.msk-nav .active { color: #1C1C1E; border-bottom-color: #007AFF; }
.msk-nav .msk-nav-teacher { margin-left: 8px; background: #1C1C1E; color: #FFFFFF; border-bottom-color: #1C1C1E; padding: 12px 18px; }
.msk-nav .msk-nav-teacher:hover { color: #FFFFFF; background: #007AFF; border-bottom-color: #007AFF; }
.msk-nav .msk-nav-teacher.active { background: #007AFF; border-bottom-color: #007AFF; color: #FFFFFF; }
@media (max-width: 760px) {
  .msk-banner-inner { padding: 6px 16px 0; }
  .msk-brand img { width: 36px; }
  .msk-brand span { font-size: 1.35rem; }
  .msk-nav { width: 100%; margin: 0 -6px; }
  .msk-nav a, .msk-nav button { font-size: 0.88rem; padding: 10px 10px 8px; }
  .msk-nav .msk-nav-teacher { margin-left: auto; padding: 10px 12px; }
}

/* ─── Home ─── */
.msk-home { font-family: 'Nunito Sans', sans-serif; color: #1C1C1E; }
.msk-intro { padding: 72px 0 24px; }
.msk-kicker { margin: 0 0 18px; font-weight: 700; font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: #0057CC; }
.msk-h1 { margin: 0; max-width: 880px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -0.02em; }
.msk-lead { margin: 26px 0 0; max-width: 680px; font-size: 1.25rem; line-height: 1.6; color: #3C3C43; }
.msk-cred { margin: 22px 0 0; display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 700; }
.msk-cred svg { flex: none; }
.msk-stats { margin: 44px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 900px; border-top: 2px solid #1C1C1E; }
.msk-stats div { padding: 16px 20px 0 0; }
.msk-stats dt { font-size: 0.875rem; font-weight: 600; color: #6B6B70; }
.msk-stats dd { margin: 4px 0 0; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 2.5rem; }
.msk-jump { margin-top: 56px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: #1C1C1E; text-decoration: none; }
.msk-jump:hover { color: #007AFF; }
.msk-options { padding: 80px 0 120px; }
.msk-options h2 { margin: 0 0 30px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.12em; text-transform: uppercase; color: #0057CC; }
@media (max-width: 640px) {
  .msk-intro { padding: 40px 0 8px; }
  .msk-lead { font-size: 1.06rem; }
  .msk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .msk-stats dd { font-size: 1.9rem; }
  .msk-options { padding: 140px 0 48px; }
  .msk-options h2 { font-size: 0.95rem; margin-bottom: 16px; }
}

/* ─── Lift-pass tickets ─── */
.tk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; align-items: start; }
.tk-wrap {
  display: block;
  text-decoration: none;
  text-align: left;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 14px 18px rgba(20,60,120,0.20));
  transition: transform 0.18s ease;
}
.tk-grid > .tk-wrap:nth-child(1) { transform: rotate(-2deg); }
.tk-grid > .tk-wrap:nth-child(2) { transform: rotate(1.5deg); margin-top: 14px; }
.tk-grid > .tk-wrap:nth-child(3) { transform: rotate(-1deg); margin-top: 4px; }
.tk-grid > .tk-wrap:nth-child(4) { transform: rotate(2deg); margin-top: 18px; }
.tk-grid > .tk-wrap:hover, .tk-grid > .tk-wrap:focus-visible { transform: translateY(-8px) rotate(0deg); }
.tk-wrap:focus-visible { outline: 3px solid #007AFF; outline-offset: 6px; }
.tk {
  display: flex;
  flex-direction: column;
  height: 440px;
  background: #FFFFFF;
  color: #1C1C1E;
  -webkit-mask:
    radial-gradient(circle 15px at 0 76%, #0000 98%, #000 100%),
    radial-gradient(circle 15px at 100% 76%, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 0 0, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 100% 0, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 0 100%, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 100% 100%, #0000 98%, #000 100%);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle 15px at 0 76%, #0000 98%, #000 100%),
    radial-gradient(circle 15px at 100% 76%, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 0 0, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 100% 0, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 0 100%, #0000 98%, #000 100%),
    radial-gradient(circle 12px at 100% 100%, #0000 98%, #000 100%);
  mask-composite: intersect;
}
.tk-head { display: flex; flex-direction: column; gap: 2px; padding: 22px 24px 18px; background: #007AFF; color: #FFFFFF; }
.tk-kicker { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; }
.tk-admit { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.tk-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; }
.tk-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.9rem; line-height: 1; }
.tk-desc { font-size: 0.95rem; line-height: 1.5; color: #3C3C43; }
.tk-perf { margin: 0 22px; border-top: 3px dotted #AEAEB2; }
.tk-stub { display: flex; flex-direction: column; gap: 8px; padding: 14px 24px 22px; }
.tk-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tk-no { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #6B6B70; }
.tk-price { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.15rem; text-transform: uppercase; text-align: right; }
.tk-price small { font-size: 0.7rem; letter-spacing: 0.06em; color: #6B6B70; margin-right: 6px; }
.tk-price.free { color: #1A7F3C; }
.tk-code { height: 34px; background: repeating-linear-gradient(90deg, #1C1C1E 0 2px, transparent 2px 4px, #1C1C1E 4px 5px, transparent 5px 8px, #1C1C1E 8px 11px, transparent 11px 13px); }
.tk.dark { background: #1C1C1E; color: #FFFFFF; }
.tk.dark .tk-head { background: #FFFFFF; color: #1C1C1E; }
.tk.dark .tk-admit { color: #0057CC; opacity: 1; }
.tk.dark .tk-desc { color: #D1D1D6; }
.tk.dark .tk-perf { border-top-color: #6B6B70; }
.tk.dark .tk-no, .tk.dark .tk-price small { color: #AEAEB2; }
.tk.dark .tk-code { background: repeating-linear-gradient(90deg, #FFFFFF 0 2px, transparent 2px 4px, #FFFFFF 4px 5px, transparent 5px 8px, #FFFFFF 8px 11px, transparent 11px 13px); }

@media (max-width: 1040px) {
  .tk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
}
/* Phone: horizontal tickets */
@media (max-width: 640px) {
  .tk-grid { grid-template-columns: 1fr; gap: 16px; }
  .tk-grid > .tk-wrap:nth-child(n) { transform: none; margin-top: 0; }
  .tk-grid > .tk-wrap:hover { transform: translateY(-3px); }
  .tk {
    flex-direction: row;
    height: auto;
    min-height: 150px;
    -webkit-mask:
      radial-gradient(circle 12px at 74% 0, #0000 98%, #000 100%),
      radial-gradient(circle 12px at 74% 100%, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 0 0, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 100% 0, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 0 100%, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 100% 100%, #0000 98%, #000 100%);
    -webkit-mask-composite: source-in;
    mask:
      radial-gradient(circle 12px at 74% 0, #0000 98%, #000 100%),
      radial-gradient(circle 12px at 74% 100%, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 0 0, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 100% 0, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 0 100%, #0000 98%, #000 100%),
      radial-gradient(circle 9px at 100% 100%, #0000 98%, #000 100%);
    mask-composite: intersect;
  }
  .tk-head { width: 26px; flex: none; padding: 0; align-items: center; justify-content: center; }
  .tk-kicker { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.6rem; white-space: nowrap; }
  .tk-kicker .tk-brand, .tk-admit { display: none; }
  .tk-body { width: calc(74% - 26px); flex: none; box-sizing: border-box; padding: 16px 14px 16px 16px; gap: 6px; }
  .tk-title { font-size: 1.35rem; line-height: 1.05; }
  .tk-desc { font-size: 0.875rem; line-height: 1.45; }
  .tk-perf { margin: 14px 0; border-top: 0; border-left: 3px dotted #AEAEB2; }
  .tk.dark .tk-perf { border-left-color: #6B6B70; }
  .tk-stub { flex: 1; flex-direction: row; gap: 8px; padding: 14px 10px 14px 12px; min-width: 0; }
  .tk-meta { flex-direction: column; justify-content: space-between; align-items: flex-start; }
  .tk-price { font-size: 0.95rem; text-align: left; line-height: 1.1; display: flex; flex-direction: column-reverse; }
  .tk-price small { margin: 2px 0 0; font-size: 0.6rem; }
  .tk-code { height: auto; width: 26px; flex: none; background: repeating-linear-gradient(0deg, #1C1C1E 0 2px, transparent 2px 4px, #1C1C1E 4px 5px, transparent 5px 8px, #1C1C1E 8px 11px, transparent 11px 13px); }
  .tk.dark .tk-code { background: repeating-linear-gradient(0deg, #FFFFFF 0 2px, transparent 2px 4px, #FFFFFF 4px 5px, transparent 5px 8px, #FFFFFF 8px 11px, transparent 11px 13px); }
}

/* ─── Footer ─── */
.msk-footer { background: rgba(255,255,255,0.95); border-top: 1px solid rgba(28,28,30,0.12); font-family: 'Nunito Sans', sans-serif; color: #1C1C1E; text-align: left; }
.msk-footer-inner { max-width: 1160px; margin: 0 auto; padding: 48px 32px 28px; }
.msk-footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid rgba(28,28,30,0.12); }
.msk-footer-cols p { margin: 12px 0 0; font-size: 0.875rem; line-height: 1.6; color: #6B6B70; }
.msk-footer h3 { margin: 0 0 12px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.95rem; }
.msk-footer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 0.95rem; }
.msk-footer a { color: #3C3C43; text-decoration: none; }
.msk-footer a:hover { color: #007AFF; text-decoration: underline; }
.msk-footer button.msk-link { font: inherit; color: #3C3C43; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.msk-footer button.msk-link:hover { color: #007AFF; text-decoration: underline; }
.msk-footer-legal { padding-top: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 0.8rem; line-height: 1.6; color: #6B6B70; }
.msk-footer-legal p { margin: 0; }
.msk-footer-legal .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
@media (max-width: 760px) {
  .msk-footer-inner { padding: 32px 20px 24px; }
  .msk-footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .msk-footer-cols > div:first-child { grid-column: 1 / -1; }
}

/* ─── Info pages ─── */
.msk-doc { max-width: 760px; margin: 0 auto; padding: 56px 32px 96px; font-family: 'Nunito Sans', sans-serif; color: #1C1C1E; }
.msk-doc-sheet { background: rgba(255,255,255,0.92); border-top: 4px solid #1C1C1E; padding: 40px 44px 48px; }
.msk-doc h1 { margin: 0 0 8px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; }
.msk-doc .updated { margin: 0 0 28px; font-size: 0.875rem; color: #6B6B70; }
.msk-doc h2 { margin: 34px 0 10px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.3rem; }
.msk-doc p, .msk-doc li { font-size: 1.02rem; line-height: 1.7; color: #2C2C2E; }
.msk-doc ul, .msk-doc ol { padding-left: 1.3em; }
.msk-doc li { margin-bottom: 6px; }
.msk-doc a { color: #0057CC; }
.msk-doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.msk-doc th, .msk-doc td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(28,28,30,0.12); vertical-align: top; line-height: 1.5; }
.msk-doc th { font-family: 'Nunito', sans-serif; font-weight: 800; }
.msk-doc .note { padding: 14px 18px; background: #E8F2FF; border-left: 4px solid #007AFF; margin: 20px 0; }
@media (max-width: 640px) {
  .msk-doc { padding: 24px 12px 56px; }
  .msk-doc-sheet { padding: 26px 18px 32px; }
}
.msk-footer { padding: 0; line-height: normal; font-size: 1rem; }
body[data-tab="home"] .shell { max-width: 1160px; padding: 0 32px; }
@media (max-width: 640px) { body[data-tab="home"] .shell { padding: 0 16px; } }
.msk-teach-intro { font-family: 'Nunito Sans', sans-serif; }
/* fixes */
.tk-no { white-space: nowrap; }
.tk-kicker { letter-spacing: 0.16em; }
.tk-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.tk-price small { margin: 0 0 2px; }
@media (max-width: 640px) {
  .tk-price { align-items: flex-start; }
  .msk-nav { margin: 0 -8px; gap: 0; }
  .msk-nav a, .msk-nav button { font-size: 0.8rem; padding: 10px 7px 8px; }
  .msk-nav .msk-nav-teacher { padding: 8px 10px; margin-bottom: 4px; }
}

/* ─── Question Bank: actions, full screen, print ─── */
.qb-metarow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 14px; }
.qb-metarow .qb-meta { margin: 0; }
.qb-print-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 2px solid #1C1C1E; background: #FFFFFF; color: #1C1C1E; font-family: 'Nunito Sans', sans-serif; font-weight: 700; font-size: 0.875rem; cursor: pointer; }
.qb-print-btn:hover { background: #1C1C1E; color: #FFFFFF; }
.qb-print-btn:disabled { opacity: 0.6; cursor: wait; }
.qb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qb-actions .qb-ms-btn { margin-top: 0; }
.qb-fs-btn { display: inline-flex; align-items: center; gap: 7px; font-family: 'Nunito Sans', sans-serif; font-size: 0.82rem; font-weight: 700; padding: 8px 14px; border: 1px solid rgba(28,28,30,0.18); background: #FFFFFF; color: #1C1C1E; border-radius: 9999px; cursor: pointer; }
.qb-fs-btn:hover { border-color: #1C1C1E; }

.qb-focus { position: fixed; inset: 0; z-index: 400; background: #FFFFFF; display: none; flex-direction: column; }
.qb-focus.open { display: flex; }
.qb-focus-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 28px; border-bottom: 1px solid #D8DEE8; background: #FFFFFF; }
.qb-focus-id { display: flex; flex-direction: column; min-width: 0; }
.qb-focus-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.5rem; }
.qb-focus-sub { font-size: 0.875rem; color: #6B6B70; }
.qb-focus-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qb-focus-count { font-size: 0.875rem; font-weight: 700; color: #6B6B70; margin-right: 6px; }
.qb-focus-ctrls button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 2px solid #1C1C1E; background: #FFFFFF; color: #1C1C1E; font-family: 'Nunito Sans', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.qb-focus-ctrls button:hover:not(:disabled) { background: #F3F7FC; }
.qb-focus-ctrls button:disabled { opacity: 0.35; cursor: default; }
.qb-focus-ctrls .qb-focus-sol-btn { background: #007AFF; border-color: #007AFF; color: #FFFFFF; }
.qb-focus-ctrls button.qb-focus-sol-btn:hover:not(:disabled) { background: #0055CC; border-color: #0055CC; color: #FFFFFF; }
.qb-focus-ctrls .qb-focus-min { background: #1C1C1E; color: #FFFFFF; }
.qb-focus-ctrls button.qb-focus-min:hover:not(:disabled) { background: #3C3C43; color: #FFFFFF; }
.qb-focus-body { flex: 1; overflow-y: auto; }
.qb-focus-inner { max-width: 1040px; margin: 0 auto; padding: 40px 32px 80px; }
.qb-focus .qb-focus-tags { justify-content: flex-start; margin-bottom: 22px; }
.qb-focus .qb-focus-q { font-size: 1.75rem; line-height: 1.6; }
.qb-focus .qb-focus-q .qb-part { grid-template-columns: 56px 1fr auto; margin-bottom: 14px; }
.qb-focus .qb-focus-q .qb-part-marks { font-size: 1.2rem; }
.qb-focus .qb-focus-q .qb-fig svg { max-height: 46vh; width: auto; }
.qb-focus .qb-focus-solbox { margin-top: 36px; padding-top: 24px; border-top: 3px solid #1C1C1E; font-size: 1.3rem; line-height: 1.6; }
.qb-focus-solh { margin: 0 0 16px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.4rem; }
@media (max-width: 640px) {
  .qb-focus-bar { padding: 10px 14px; }
  .qb-focus-title { font-size: 1.2rem; }
  .qb-focus-ctrls button { padding: 0 10px; font-size: 0.82rem; }
  .qb-focus-inner { padding: 22px 16px 60px; }
  .qb-focus .qb-focus-q { font-size: 1.2rem; }
  .qb-focus .qb-focus-q .qb-part { grid-template-columns: 34px 1fr auto; }
  .qb-focus .qb-focus-solbox { font-size: 1.02rem; }
  .qb-focus-ctrls { width: 100%; }
  .qb-focus-count { width: auto; margin-right: auto; }
  .qb-focus-ctrls .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .qb-focus-ctrls button { min-width: 44px; justify-content: center; }
}

.qb-panel { position: fixed; inset: 0; z-index: 450; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; padding: 16px; }
.qb-panel.open { display: flex; }
.qb-panel-box { width: 100%; max-width: 440px; background: #FFFFFF; border-top: 4px solid #1C1C1E; padding: 26px 24px 20px; font-family: 'Nunito Sans', sans-serif; display: flex; flex-direction: column; gap: 10px; }
.qb-panel-box h3 { margin: 0; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.3rem; }
.qb-panel-box p { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.55; color: #3C3C43; }
.qb-panel-primary, .qb-panel-secondary, .qb-panel-cancel { min-height: 46px; padding: 0 16px; font-family: 'Nunito Sans', sans-serif; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.qb-panel-primary { border: 0; background: #007AFF; color: #FFFFFF; }
.qb-panel-primary:hover { background: #0055CC; }
.qb-panel-secondary { border: 2px solid #1C1C1E; background: #FFFFFF; color: #1C1C1E; }
.qb-panel-secondary:hover { background: #F3F7FC; }
.qb-panel-cancel { border: 0; background: none; color: #6B6B70; }
.qb-panel-label { margin-top: 10px; font-size: 0.875rem; font-weight: 700; }
.qb-panel-row { display: flex; gap: 8px; }
.qb-panel-row input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; border: 2px solid #D8DEE8; font: inherit; font-size: 0.95rem; }
.qb-panel-row input:focus { outline: none; border-color: #007AFF; }
.qb-panel-msg { font-size: 0.875rem !important; color: #0057CC !important; min-height: 1em; }

#qbPrintSheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body::before { display: none; }
  body.qb-printing > *:not(#qbPrintSheet) { display: none !important; }
  body.qb-printing { background: #FFFFFF !important; }
  body.qb-printing #qbPrintSheet { display: block; font-family: 'Nunito Sans', sans-serif; color: #000; font-size: 10.5pt; }
  .qbp-head { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 4pt 14pt; border-bottom: 2pt solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  .qbp-brand { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 16pt; }
  .qbp-brand b { color: #007AFF; font-weight: 900; }
  .qbp-title { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12pt; }
  .qbp-lines { grid-column: 1 / -1; display: grid; grid-template-columns: 2fr 1fr; gap: 18pt; margin-top: 6pt; font-size: 9.5pt; }
  .qbp-lines span { border-bottom: 0.75pt solid #000; padding-bottom: 12pt; }
  .qbp-q, .qbp-s { padding: 6pt 0 8pt; border-bottom: 0.5pt solid #BBB; }
  .qbp-qhead { break-after: avoid; }
  #qbPrintSheet .qb-part, #qbPrintSheet .qb-fig, #qbPrintSheet .qb-body p, #qbPrintSheet .qb-sol-step, #qbPrintSheet .qb-answer, #qbPrintSheet .katex-display { break-inside: avoid; }
  .qbp-qhead { display: flex; align-items: baseline; gap: 8pt; margin-bottom: 3pt; }
  .qbp-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 12pt; }
  .qbp-meta { font-size: 8.5pt; color: #444; }
  #qbPrintSheet .qb-body { font-size: 10.5pt; line-height: 1.45; }
  #qbPrintSheet .qb-body p { margin: 0 0 4pt; }
  #qbPrintSheet .qb-part { grid-template-columns: 22pt 1fr auto; margin-bottom: 3pt; gap: 2pt; }
  #qbPrintSheet .qb-fig { margin: 4pt 0; }
  #qbPrintSheet .qb-fig svg { max-width: 8.5cm; max-height: 6.5cm; }
  #qbPrintSheet .qb-idea { background: none; border: 0.75pt solid #999; padding: 5pt 7pt; margin-bottom: 6pt; font-size: 9.5pt; }
  #qbPrintSheet .qb-sol-part { margin-bottom: 5pt; }
  #qbPrintSheet .qb-answer { background: none; border: 0.75pt solid #000; padding: 2pt 6pt; }
  #qbPrintSheet .katex-display { margin: 3pt 0; }
  .qbp-solh { break-before: page; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15pt; border-bottom: 2pt solid #000; padding-bottom: 4pt; margin: 0 0 8pt; }
  .qbp-foot { margin-top: 12pt; font-size: 7.5pt; color: #555; }
  /* Browser print (Ctrl+P) on the Question Bank without the teacher button */
  body[data-tab="qbank"]:not(.qb-printing) > * { display: none !important; }
  body[data-tab="qbank"]:not(.qb-printing)::after { content: "Printing Question Bank worksheets is part of the Mathski teacher plan. Teachers can use the Print worksheet button on mathski.io."; display: block; font: 12pt 'Nunito Sans', sans-serif; padding: 20mm 0; }
}
