/* ============================================================
   RiyBooks — Content Page: Web View Styles
   Print styles remain inline in each page (unchanged).
   This file only applies in screen (web) mode.
   ============================================================ */

/* ---------- View toggle bar ---------- */
.view-bar {
  background: #fff;
  border-bottom: 1px solid #dadce0;
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.view-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.view-bar-left a {
  font-size: 0.85rem;
  color: #1a73e8;
  text-decoration: none;
  white-space: nowrap;
}
.view-bar-left a:hover { text-decoration: underline; }

.view-bar-sep {
  color: #dadce0;
  font-size: 0.85rem;
}

.view-bar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-print-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #1a73e8;
  background: transparent;
  color: #1a73e8;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-print-view:hover {
  background: #1a73e8;
  color: #fff;
}
.btn-print-view svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-print-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #1a73e8;
  color: #fff;
  transition: background 0.15s ease;
}
.btn-print-now:hover { background: #1557b0; }
.btn-print-now svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---------- View wrapper ---------- */
@media screen {
  body.web-view,
  body.worksheet-view {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #202124;
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
  }

  /* Hide legacy .page divs in web view only */
  body.web-view .page {
    display: none;
  }

  /* Show legacy .page divs in worksheet view */
  body.worksheet-view .page {
    display: block;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 18mm 16mm;
    margin-bottom: 24px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Web view: show web-content, hide worksheet-content */
  body.web-view .web-content      { display: block; }
  body.web-view .worksheet-content { display: none; }

  /* Worksheet view: hide web-content, show worksheet-content */
  body.worksheet-view .web-content      { display: none; }
  body.worksheet-view .worksheet-content { display: block; }

  /* Fallback: if no worksheet content exists, show web-content in worksheet view */
  body.worksheet-view.no-worksheet .web-content { display: block; }

  /* Hide print CTA in worksheet view */
  body.worksheet-view .wc-print-cta { display: none; }

  /* ---------- Worksheet screen container ---------- */
  .worksheet-content {
    max-width: 820px;
    margin: 24px auto;
    padding: 0 16px 48px;
  }

  /* A4 page card on screen */
  .ws-page {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 18mm 16mm;
    margin-bottom: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13.5px;
    color: #202124;
    line-height: 1.6;
  }

  /* Worksheet header */
  .ws-page-header {
    text-align: center;
    border-bottom: 2px solid #202124;
    padding-bottom: 10px;
    margin-bottom: 14px;
  }

  .ws-page-header h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
    color: #202124;
  }

  .ws-page-header .ws-subtitle {
    font-size: 12px;
    color: #5f6368;
  }

  .ws-student-info {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    font-size: 12px;
    margin-top: 8px;
    border-top: 1px dashed #aaa;
    padding-top: 6px;
    gap: 24px;
    flex-wrap: wrap;
  }

  .ws-student-info span {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
  }

  .ws-field-line {
    display: inline-block;
    border-bottom: 1px solid #202124;
    height: 16px;
    vertical-align: bottom;
  }

  /* Section heading */
  .ws-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #202124;
    border-bottom: 1.5px solid #dadce0;
    padding-bottom: 4px;
    margin: 14px 0 8px;
  }

  /* Intro box */
  .ws-intro {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.6;
  }

  /* Key points box */
  .ws-keybox {
    background: #e6f4ea;
    border: 1.5px solid #34a853;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
  }

  .ws-keybox .ws-kb-title {
    font-weight: 700;
    font-size: 12px;
    color: #0d652d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .ws-keybox ul { margin-left: 16px; }
  .ws-keybox li { margin-bottom: 4px; font-size: 12.5px; }

  /* Think box */
  .ws-think {
    background: #f3e8fd;
    border-left: 4px solid #9c27b0;
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    font-style: italic;
    font-size: 12.5px;
    color: #4a148c;
    margin: 10px 0;
  }

  /* Example box */
  .ws-example {
    background: #fff8e1;
    border-left: 4px solid #fbbc04;
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    font-size: 12.5px;
    margin: 10px 0;
  }

  /* Activity box */
  .ws-activity {
    background: #fce8e6;
    border: 2px dashed #ea4335;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0;
  }

  .ws-activity .ws-act-title {
    font-weight: 700;
    font-size: 13px;
    color: #c5221f;
    margin-bottom: 8px;
  }

  /* Tables */
  .ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin: 10px 0;
  }

  .ws-table th {
    background: #f1f3f4;
    font-weight: 700;
    padding: 7px 10px;
    text-align: left;
    border: 1px solid #dadce0;
    font-size: 12px;
  }

  .ws-table td {
    padding: 6px 10px;
    border: 1px solid #dadce0;
    vertical-align: top;
  }

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

  /* Images */
  .ws-img {
    display: block;
    max-width: 60%;
    height: auto;
    margin: 10px auto;
    border-radius: 6px;
  }

  /* Questions */
  .ws-q-group { margin-bottom: 16px; }

  .ws-q-group-title {
    font-weight: 700;
    font-size: 12px;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
  }

  .ws-question {
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.6;
  }

  .ws-q-num { font-weight: 700; color: #1a73e8; margin-right: 4px; }

  .ws-blank {
    display: inline-block;
    min-width: 90px;
    border-bottom: 1.5px solid #202124;
    margin: 0 3px;
    height: 18px;
    vertical-align: bottom;
  }

  .ws-blank-long {
    display: inline-block;
    min-width: 150px;
    border-bottom: 1.5px solid #202124;
    margin: 0 3px;
    height: 18px;
    vertical-align: bottom;
  }

  .ws-answer-area {
    background: #fff;
    border: 1px dashed #aaa;
    border-radius: 4px;
    min-height: 44px;
    margin-top: 6px;
    padding: 6px;
  }

  .ws-mcq-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .ws-mcq-options span {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
  }

  /* Subject badge */
  .ws-subject-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #fff;
    margin-bottom: 4px;
  }

  /* Print CTA */
  .ws-print-cta {
    text-align: center;
    padding: 24px 20px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    margin-top: 8px;
  }

  .ws-print-cta p {
    font-size: 0.9rem;
    color: #5f6368;
    margin-bottom: 12px;
  }

  /* ---------- Web content layout ---------- */
  .web-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 20px 60px;
  }

  /* Page title */
  .wc-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #dadce0;
  }

  .wc-subject-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    color: #fff;
  }
  .tag-maths   { background: #ea4335; }
  .tag-english { background: #4285f4; }
  .tag-evs     { background: #34a853; }
  .tag-bengali { background: #9c27b0; }
  .tag-gk      { background: #ff6d00; }

  .wc-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    color: #202124;
    margin-bottom: 6px;
  }

  .wc-header .wc-meta {
    font-size: 0.85rem;
    color: #5f6368;
  }

  /* ---------- Sections ---------- */
  .wc-section {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }

  .wc-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #202124;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f4;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .wc-section h2 .sec-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  /* ---------- Intro / info box ---------- */
  .wc-intro {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.65;
  }

  /* ---------- Key points box ---------- */
  .wc-keybox {
    background: #e6f4ea;
    border: 1.5px solid #34a853;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
  }

  .wc-keybox .kb-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #0d652d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .wc-keybox ul {
    margin-left: 18px;
  }

  .wc-keybox li {
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #202124;
  }

  /* ---------- Example box ---------- */
  .wc-example {
    background: #fff8e1;
    border-left: 4px solid #fbbc04;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
  }

  .wc-example .ex-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #b06000;
    margin-bottom: 6px;
  }

  /* ---------- Tables ---------- */
  .wc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 12px 0;
  }

  .wc-table th {
    background: #f1f3f4;
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border: 1px solid #dadce0;
    font-size: 0.85rem;
  }

  .wc-table td {
    padding: 9px 14px;
    border: 1px solid #dadce0;
    vertical-align: top;
  }

  .wc-table tr:nth-child(even) td { background: #f8f9fa; }

  /* ---------- Practice questions ---------- */
  .wc-questions {
    counter-reset: q-counter;
  }

  .wc-q-group {
    margin-bottom: 20px;
  }

  .wc-q-group-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 12px;
  }

  .wc-question {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .wc-question .q-num {
    font-weight: 700;
    color: #1a73e8;
    margin-right: 6px;
  }

  /* MCQ options */
  .wc-mcq-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }

  .wc-mcq-options span {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.85rem;
    cursor: default;
  }

  /* Fill-in-the-blank */
  .wc-blank {
    display: inline-block;
    min-width: 100px;
    border-bottom: 2px solid #1a73e8;
    margin: 0 4px;
    height: 20px;
    vertical-align: bottom;
  }

  /* Answer area */
  .wc-answer-area {
    background: #fff;
    border: 1px dashed #dadce0;
    border-radius: 6px;
    min-height: 48px;
    margin-top: 8px;
    padding: 8px;
    font-size: 0.85rem;
    color: #9aa0a6;
  }

  /* ---------- Activity box ---------- */
  .wc-activity {
    background: #fce8e6;
    border: 2px dashed #ea4335;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
  }

  .wc-activity .act-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #c5221f;
    margin-bottom: 10px;
  }

  /* ---------- Think box ---------- */
  .wc-think {
    background: #f3e8fd;
    border-left: 4px solid #9c27b0;
    border-radius: 0 8px 8px 0;
    padding: 10px 16px;
    font-style: italic;
    font-size: 0.9rem;
    color: #4a148c;
    margin: 10px 0;
  }

  /* ---------- Objectives list ---------- */
  .wc-objectives {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .wc-objectives li {
    padding: 6px 0 6px 28px;
    position: relative;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f3f4;
  }

  .wc-objectives li:last-child { border-bottom: none; }

  .wc-objectives li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #34a853;
    font-weight: 700;
  }

/* ---------- Image placeholders ---------- */
  .wc-image-placeholder {
    background: #f8f9fa;
    border: 2px dashed #1a73e8;
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
  }

  .wc-img-prompt {
    padding: 16px 20px;
    font-size: 0.82rem;
    color: #5f6368;
    line-height: 1.6;
  }

  .wc-img-prompt strong {
    color: #1a73e8;
  }

  /* Once a real image is placed, hide the prompt */
  .wc-image-placeholder img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
  }

  .wc-image-placeholder img + .wc-img-prompt {
    display: none;
  }

  /* ---------- Print CTA at bottom ---------- */
  .wc-print-cta {
    text-align: center;
    padding: 28px 20px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    margin-top: 32px;
  }

  .wc-print-cta p {
    font-size: 0.95rem;
    color: #5f6368;
    margin-bottom: 14px;
  }

  /* ---------- Responsive: tablet ---------- */
  @media (max-width: 768px) {
    .web-content {
      padding: 24px 16px 56px;
    }

    .wc-header h1 {
      font-size: 1.5rem;
    }

    .wc-section {
      padding: 20px 18px;
      border-radius: 10px;
    }

    /* Tables: allow horizontal scroll on tablet */
    .wc-table {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      white-space: nowrap;
    }

    .wc-table th,
    .wc-table td {
      white-space: normal;
      min-width: 100px;
    }
  }

  /* ---------- Responsive: mobile ---------- */
  @media (max-width: 480px) {
    /* View bar: compact single row */
    .view-bar {
      padding: 8px 12px;
      gap: 8px;
      flex-wrap: nowrap;
    }

    .view-bar-left {
      gap: 6px;
      flex: 1;
      min-width: 0;
    }

    /* Hide the topic title in the breadcrumb on small screens — saves space */
    .view-bar-title {
      display: none;
    }

    /* Shrink breadcrumb text */
    .view-bar-left a,
    .view-bar-sep {
      font-size: 0.78rem;
    }

    /* Icon-only buttons on mobile */
    .btn-print-view,
    .btn-print-now {
      padding: 7px 10px;
      font-size: 0;        /* hide text */
      gap: 0;
      border-radius: 8px;
      min-width: 36px;
      justify-content: center;
    }

    .btn-print-view svg,
    .btn-print-now svg {
      width: 18px;
      height: 18px;
    }

    /* Content area */
    .web-content {
      padding: 16px 12px 64px;
    }

    .wc-header {
      margin-bottom: 20px;
      padding-bottom: 16px;
    }

    .wc-header h1 {
      font-size: 1.3rem;
      line-height: 1.3;
    }

    .wc-subject-tag {
      font-size: 0.7rem;
      padding: 2px 8px;
      margin-bottom: 8px;
    }

    /* Sections */
    .wc-section {
      padding: 16px 14px;
      border-radius: 8px;
      margin-bottom: 14px;
    }

    .wc-section h2 {
      font-size: 0.95rem;
      margin-bottom: 12px;
      padding-bottom: 8px;
      flex-wrap: wrap;
    }

    .wc-section h2 .sec-icon {
      width: 22px;
      height: 22px;
      font-size: 0.75rem;
    }

    /* Intro box */
    .wc-intro {
      padding: 12px 14px;
      font-size: 0.9rem;
    }

    /* Key box */
    .wc-keybox {
      padding: 14px 16px;
      border-radius: 8px;
    }

    .wc-keybox li {
      font-size: 0.875rem;
    }

    /* Example box */
    .wc-example {
      padding: 10px 12px;
      font-size: 0.875rem;
    }

    /* Think box */
    .wc-think {
      padding: 10px 12px;
      font-size: 0.875rem;
    }

    /* Tables: horizontal scroll with visible indicator */
    .wc-table {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border-radius: 6px;
      /* subtle shadow on right edge to hint scrollability */
      background:
        linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 0 100%,
        radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.08), transparent),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.08), transparent) 0 100%;
      background-repeat: no-repeat;
      background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
      background-attachment: local, local, scroll, scroll;
    }

    .wc-table th,
    .wc-table td {
      padding: 8px 10px;
      font-size: 0.82rem;
      white-space: normal;
      min-width: 90px;
    }

    /* Questions */
    .wc-question {
      padding: 12px 12px;
      font-size: 0.875rem;
      margin-bottom: 8px;
    }

    .wc-q-group-title {
      font-size: 0.8rem;
      margin-bottom: 10px;
    }

    /* MCQ options: stack vertically on very small screens */
    .wc-mcq-options {
      flex-direction: column;
      gap: 6px;
      margin-top: 8px;
    }

    .wc-mcq-options span {
      font-size: 0.82rem;
      padding: 6px 10px;
    }

    /* Blank */
    .wc-blank {
      min-width: 70px;
    }

    /* Answer area */
    .wc-answer-area {
      min-height: 56px;
    }

    /* Activity box */
    .wc-activity {
      padding: 14px 14px;
      border-radius: 8px;
    }

    .wc-activity .act-title {
      font-size: 0.9rem;
    }

    /* Objectives */
    .wc-objectives li {
      font-size: 0.875rem;
      padding-left: 24px;
    }

    /* Print CTA */
    .wc-print-cta {
      padding: 20px 16px;
      border-radius: 10px;
      margin-top: 24px;
    }

    .wc-print-cta p {
      font-size: 0.875rem;
    }

    /* Print CTA button: full width on mobile */
    .wc-print-cta .btn-print-now {
      font-size: 0.875rem;
      padding: 10px 20px;
      width: 100%;
      justify-content: center;
    }
  }
}

/* ---------- Print: always print worksheet-content in colour ---------- */
@media print {
  .view-bar        { display: none !important; }
  .wc-print-cta    { display: none !important; }
  .ws-print-cta    { display: none !important; }

  /* Hide web content, show worksheet */
  .web-content         { display: none !important; }
  .worksheet-content   {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Show legacy .page divs for print */
  .page {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Fallback: if no worksheet content exists, print web-content */
  body.no-worksheet .web-content { display: block !important; }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Page cards become real pages */
  .ws-page {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always;
    font-size: 11pt;
    line-height: 1.55;
    color: #000;
  }
  .ws-page:last-child { page-break-after: avoid; }

  /* Header */
  .ws-page-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .ws-page-header h1 { font-size: 16pt; font-weight: 800; margin-bottom: 2px; }
  .ws-page-header .ws-subtitle { font-size: 10pt; color: #333; }

  .ws-student-info {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    font-size: 10pt;
    margin-top: 6px;
    border-top: 1px dashed #999;
    padding-top: 5px;
    gap: 24pt;
    flex-wrap: wrap;
  }

  .ws-student-info span {
    display: flex;
    align-items: baseline;
    gap: 4pt;
    white-space: nowrap;
  }

  .ws-field-line { border-bottom: 1px solid #000; }

  /* Section heading */
  .ws-section-title {
    font-size: 11pt;
    font-weight: 700;
    border-bottom: 1px solid #dadce0;
    padding-bottom: 3px;
    margin: 12px 0 6px;
    page-break-after: avoid;
  }

  /* Boxes — coloured */
  .ws-intro {
    background: #e8f0fe !important;
    border-left: 4px solid #1a73e8 !important;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 10.5pt;
    page-break-inside: avoid;
  }

  .ws-keybox {
    background: #e6f4ea !important;
    border: 1.5px solid #34a853 !important;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 0;
    page-break-inside: avoid;
  }
  .ws-keybox .ws-kb-title { font-size: 9.5pt; color: #0d652d; }
  .ws-keybox li { font-size: 10pt; margin-bottom: 2px; }

  .ws-think {
    background: #f3e8fd !important;
    border-left: 4px solid #9c27b0 !important;
    padding: 6px 10px;
    font-size: 10pt;
    margin: 8px 0;
    page-break-inside: avoid;
  }

  .ws-example {
    background: #fff8e1 !important;
    border-left: 4px solid #fbbc04 !important;
    padding: 6px 10px;
    font-size: 10pt;
    margin: 8px 0;
    page-break-inside: avoid;
  }

  .ws-activity {
    background: #fce8e6 !important;
    border: 2px dashed #ea4335 !important;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    page-break-inside: avoid;
  }

  /* Tables */
  .ws-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    margin: 8px 0;
    page-break-inside: avoid;
  }
  .ws-table th {
    background: #f1f3f4 !important;
    padding: 5px 8px;
    border: 1px solid #dadce0;
    font-size: 9.5pt;
  }
  .ws-table td {
    padding: 4px 8px;
    border: 1px solid #dadce0;
    vertical-align: top;
  }
  .ws-table tr:nth-child(even) td { background: #f8f9fa !important; }
  tr { page-break-inside: avoid; }
  thead { display: table-header-group; }

  /* Images — colourful, constrained */
  .ws-img {
    display: block !important;
    max-width: 55% !important;
    max-height: 120px !important;
    height: auto !important;
    margin: 8px auto !important;
    border-radius: 4px;
    page-break-inside: avoid !important;
  }

  /* Questions */
  .ws-q-group { margin-bottom: 10px; page-break-inside: avoid; }
  .ws-q-group-title { font-size: 9.5pt; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; }
  .ws-question { font-size: 10.5pt; margin-bottom: 6px; line-height: 1.55; }
  .ws-q-num { font-weight: 700; margin-right: 3px; }

  .ws-blank {
    display: inline-block;
    min-width: 80px;
    border-bottom: 1.5px solid #000;
    margin: 0 3px;
    height: 14px;
    vertical-align: bottom;
  }

  .ws-blank-long {
    display: inline-block;
    min-width: 130px;
    border-bottom: 1.5px solid #000;
    margin: 0 3px;
    height: 14px;
    vertical-align: bottom;
  }

  .ws-answer-area {
    background: #fff !important;
    border: 1px dashed #aaa;
    border-radius: 3px;
    min-height: 36px;
    margin-top: 4px;
    padding: 4px;
  }

  .ws-mcq-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }
  .ws-mcq-options span {
    background: #fff !important;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 9.5pt;
  }

  .ws-subject-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 8pt;
    font-weight: 700;
    color: #fff !important;
    margin-bottom: 3px;
  }

  @page {
    size: A4 portrait;
    margin: 12mm 14mm;
  }
}

