/* ═════════════════════════════════════════════════════════════════════
   KIDS SIKHO MASTER WORKSHEETS ACADEMY — CSS & PRINT STYLES
   100% Crisp Standard A4 Portrait (210mm x 297mm) Layout
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --bg-soft: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --paper-width: 210mm;
  --paper-height: 297mm;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Baloo 2', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #F1F5F9;
  color: var(--text-main);
  line-height: 1.4;
  min-height: 100vh;
}

/* ── Top Header Navigation Bar ── */
.ws-navbar {
  background: white;
  border-bottom: 2px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.ws-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.ws-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.ws-logo-icon {
  font-size: 2.2rem;
  background: #EEF2FF;
  border-radius: 14px;
  padding: 4px 8px;
  border: 2px solid #C7D2FE;
}
.ws-logo-text h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #1E1B4B;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-logo-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0;
}
.ws-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-nav {
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.88rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-nav-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary-hover);
}
.btn-nav-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-nav-outline {
  background: white;
  color: #334155;
  border-color: #CBD5E1;
}
.btn-nav-outline:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}
.btn-nav-bundle {
  background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
  color: white;
  border-color: #6D28D9;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}
.btn-nav-bundle:hover {
  background: linear-gradient(135deg, #6D28D9 0%, #4338CA 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.38);
}

/* ── Hero / Filter Section ── */
.ws-hero {
  background: linear-gradient(135deg, #4338CA 0%, #6366F1 50%, #818CF8 100%);
  color: white;
  padding: 30px 20px 25px;
  text-align: center;
}
.ws-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.ws-hero h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 6px;
}
.ws-hero p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Student Profile Controls in Hero */
.ws-kid-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 auto 20px;
  max-width: 950px;
}
.ws-kid-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ws-kid-field label {
  font-size: 0.84rem;
  font-weight: 800;
  color: white;
  white-space: nowrap;
}
.ws-kid-field input,
.ws-kid-field select {
  background: white;
  border: 1.5px solid #CBD5E1;
  border-radius: 30px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #1E1B4B;
  outline: none;
  transition: all 0.2s;
}
.ws-kid-field input:focus,
.ws-kid-field select:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}
.ws-kid-field input {
  width: 130px;
}
.ws-kid-hint {
  font-size: 0.78rem;
  color: #FEF3C7;
  font-weight: 700;
  width: 100%;
  text-align: center;
  margin-top: 2px;
}

/* Class / Age Selector Pills */
.ws-class-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.class-pill-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: white;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.class-pill-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}
.class-pill-btn.active {
  background: white;
  color: #4338CA;
  border-color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.18);
}

/* Subject Filter Bar */
.ws-subject-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.subject-pill-btn {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  color: #334155;
  padding: 7px 16px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.subject-pill-btn:hover {
  background: #EEF2FF;
  border-color: #A5B4FC;
  color: #4338CA;
}
.subject-pill-btn.active {
  background: #4F46E5;
  color: white;
  border-color: #4338CA;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

/* Search and Difficulty Filter Controls */
.ws-subfilter-row {
  max-width: 1200px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 20px;
}
.ws-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid #CBD5E1;
  border-radius: 50px;
  padding: 6px 16px;
  flex: 1;
  max-width: 420px;
  position: relative;
}
.search-clear-btn {
  background: #E2E8F0;
  color: #64748B;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.search-clear-btn:hover {
  background: #CBD5E1;
  color: #0F172A;
}
.catalog-counter-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748B;
  background: #E2E8F0;
  padding: 3px 10px;
  border-radius: 20px;
}
.diff-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748B;
  margin-right: 4px;
}
.badge-pill {
  font-size: 0.72rem;
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #FDE68A;
  margin-left: 6px;
}
.toolbar-info-badge {
  background: #EEF2FF;
  color: #4338CA;
  border: 1.5px solid #C7D2FE;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 800;
}
.ws-search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}
.ws-diff-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 4px 6px;
  border-radius: 50px;
  border: 1.5px solid #CBD5E1;
}
.diff-btn {
  padding: 5px 12px;
  border-radius: 50px;
  border: none;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  color: #64748B;
  transition: all 0.15s;
}
.diff-btn.active {
  background: #F59E0B;
  color: white;
}

/* ── Worksheet Catalog Grid ── */
.ws-catalog-wrap {
  max-width: 1400px;
  margin: 24px auto 60px;
  padding: 0 20px;
}
.ws-catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.ws-catalog-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Worksheet Card */
.ws-card {
  background: white;
  border-radius: 20px;
  border: 2px solid #E2E8F0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.ws-card:hover {
  transform: translateY(-4px);
  border-color: #818CF8;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.15);
}
.ws-card-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  height: 180px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ws-card-badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.ws-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}
.badge-class { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; }
.badge-diff { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.ws-card-info h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 4px;
  line-height: 1.3;
}
.ws-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.35;
}
.ws-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
}
.btn-open-sheet {
  background: #4F46E5;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 7px 16px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}
.btn-open-sheet:hover {
  background: #4338CA;
}

/* ═════════════════════════════════════════════════════════════════════
   MODAL / VIEWER STUDIO OVERLAY
   ═════════════════════════════════════════════════════════════════════ */
.ws-studio-modal {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  overflow-y: auto;
  padding: 20px;
}
.ws-studio-modal.show {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Floating Action Toolbar on Studio */
.ws-studio-toolbar {
  position: sticky;
  top: 10px;
  z-index: 100;
  background: white;
  border: 2px solid #CBD5E1;
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.toolbar-btn {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.toolbar-btn-back {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}
.toolbar-btn-back:hover { background: #E2E8F0; }
.toolbar-btn-gen {
  background: #F59E0B;
  color: white;
  border-color: #D97706;
}
.toolbar-btn-gen:hover { background: #D97706; transform: scale(1.02); }
.toolbar-btn-print {
  background: #10B981;
  color: white;
  border-color: #059669;
}
.toolbar-btn-print:hover { background: #059669; transform: scale(1.02); }
.toolbar-btn-ans {
  background: #EEF2FF;
  color: #4338CA;
  border-color: #C7D2FE;
}
.toolbar-btn-ans:hover { background: #E0E7FF; }
.toolbar-btn-pack {
  background: #6366F1;
  color: white;
  border-color: #4F46E5;
}

/* ═════════════════════════════════════════════════════════════════════
   THE A4 PAPER CANVAS (PRINT-PERFECT SPECIFICATION)
   210mm x 297mm (Standard International A4)
   ═════════════════════════════════════════════════════════════════════ */
.a4-page-paper {
  width: var(--paper-width);
  min-height: var(--paper-height);
  background: white;
  margin: 0 auto 30px;
  padding: 14mm 14mm 12mm;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1.5px solid #CBD5E1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

/* On mobile/smaller screens: scale paper to fit nicely */
@media screen and (max-width: 900px) {
  .a4-page-paper {
    width: 96vw;
    min-height: auto;
    padding: 12px;
  }
}

/* Outer Border Frame (Double / Kid-friendly Border) */
.a4-paper-inner-frame {
  border: 2px solid #1E293B;
  border-radius: 12px;
  padding: 10px 14px;
  min-height: calc(var(--paper-height) - 26mm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ── Top Header Section of Worksheet ── */
.a4-ws-header {
  border-bottom: 2px dashed #94A3B8;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.a4-brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.a4-brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.15rem;
  color: #1E293B;
}
.a4-brand-badge {
  font-size: 0.75rem;
  font-weight: 800;
  border: 1.5px solid #1E293B;
  padding: 2px 8px;
  border-radius: 30px;
  background: #FFFBEB;
}
.a4-title-row {
  text-align: center;
  margin: 4px 0 10px;
}
.a4-ws-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
}
.a4-ws-instructions {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 700;
  margin-top: 2px;
}
.a4-meta-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr 1fr;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #334155;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  padding: 6px 12px;
  border-radius: 8px;
}
.a4-meta-item span.field-val {
  font-weight: 900;
  color: #0F172A;
  border-bottom: 1.5px dotted #64748B;
  padding: 0 4px;
}

/* ── Content Body Section ── */
.a4-ws-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 0;
}

/* ── Footer Section ── */
.a4-ws-footer {
  border-top: 1.5px dashed #94A3B8;
  padding-top: 6px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748B;
  font-weight: 700;
}
.a4-qr-seal {
  display: flex;
  align-items: center;
  gap: 6px;
}
.a4-stars-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: #1E293B;
}

/* ═════════════════════════════════════════════════════════════════════
   SPECIALIZED TEMPLATE STYLES
   ═════════════════════════════════════════════════════════════════════ */

/* 1. MATCH THE RIGHT ANSWER (Sheet 1 from User Photo) */
.match-count-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  padding: 10px 15px;
}
.match-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.match-item-card {
  border: 2px dashed #475569;
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  position: relative;
}
.match-visual-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.9rem;
  flex-wrap: wrap;
}
.match-dot {
  width: 14px;
  height: 14px;
  background: #0F172A;
  border-radius: 50%;
  display: inline-block;
  margin-left: 10px;
}
.match-target-card {
  border: 2px solid #CBD5E1;
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  background: #F8FAFC;
}
.match-num-hand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.match-num-hand .big-digit {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1E293B;
  min-width: 32px;
}
.match-num-hand .finger-hand {
  font-size: 2.2rem;
}

/* 2. LINE TRACING (Sheet 2 from User Photo) */
.line-tracing-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 10px 0;
}
.line-trace-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.line-trace-icon {
  font-size: 1.8rem;
  width: 38px;
  text-align: center;
}
.line-trace-svg {
  flex: 1;
  height: 48px;
  overflow: visible;
}
.line-trace-svg path {
  fill: none;
  stroke: #475569;
  stroke-width: 3;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
}

/* 3. CIRCLE RIGHT WORD (Sheet 3 from User Photo) */
.circle-grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 8px 0;
}
.circle-word-card {
  border: 1.5px solid #1E293B;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 125px;
}
.circle-word-img {
  font-size: 2.8rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 55px;
}
.circle-word-options {
  display: flex;
  justify-content: center;
  gap: 12px;
  width: 100%;
}
.circle-word-opt {
  font-weight: 800;
  font-size: 0.92rem;
  color: #1E293B;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px dashed transparent;
}

/* 4. MATCH THE ALPHABETS (Sheet 4 from User Photo) */
.alpha-match-layout {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
}
.alpha-center-badges {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.alpha-badge-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #0F172A;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.4rem;
  color: #1E293B;
  position: relative;
}
.alpha-badge-circle .dot-left {
  position: absolute;
  left: -8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0F172A;
}
.alpha-badge-circle .dot-right {
  position: absolute;
  right: -8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0F172A;
}
.alpha-item-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 1.6rem;
}
.alpha-item-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 1.6rem;
}

/* 5. CLEAN ADDITION & MATH (Sheet 5 from User Photo) */
.math-2col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 40px;
  padding: 16px 20px;
}
.math-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.6rem;
  font-weight: 900;
  color: #0F172A;
  border-bottom: 1.5px solid #CBD5E1;
  padding: 8px 10px;
}
.math-sum-row .math-ans-blank {
  width: 90px;
  border-bottom: 2px solid #0F172A;
  height: 32px;
}

/* 5b. PROFESSIONAL 4-COLUMN VERTICAL MATH (Matching User's Reference Sheet) */
.math-vert-4col-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 18px;
  padding: 20px 14px 16px;
  justify-items: center;
  flex: 1;
}
.math-vert-item,
.math-vert-problem-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  font-size: 2.3rem;
  font-weight: 900;
  color: #0F172A;
  width: 86px;
}
.math-vert-qnum {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748B;
  line-height: 1;
  margin-bottom: 2px;
}
.math-vert-top {
  padding-right: 14px;
  line-height: 1.1;
}
.math-vert-bottom {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding-right: 14px;
  line-height: 1.1;
}
.math-vert-op {
  font-size: 1.9rem;
  padding-left: 2px;
  line-height: 1.1;
}
.math-vert-divider {
  width: 100%;
  height: 2px;
  background: #0F172A;
  margin: 4px 0 12px 0;
}
.math-vert-ans-line {
  width: 100%;
  height: 2px;
  background: #0F172A;
}

/* 6. FOUR-LINE HANDWRITING RULING (English Tracing - Full Page Workbook) */
.four-line-page-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.ws-hwriting-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #CBD5E1;
  border-radius: 12px;
  padding: 8px 14px;
  background: #F8FAFC;
  gap: 14px;
}
.ws-hwriting-char-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ws-hwriting-big-char {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: #1E1B4B;
  border: 2px solid #6366F1;
  border-radius: 10px;
  padding: 4px 16px;
  background: #EEF2FF;
}
.ws-hwriting-word-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ws-hwriting-icon {
  font-size: 2.8rem;
  line-height: 1;
}
.ws-hwriting-word-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  margin-bottom: 2px;
}
.ws-hwriting-hi {
  color: #64748B;
  font-weight: 700;
  font-size: 0.95rem;
}
.ws-hwriting-sub-rule {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}
.ws-badge-sound {
  background: #E0E7FF;
  color: #3730A3;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.78rem;
}
.ws-hwriting-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}

/* 4-Line Notebook Row Structure */
.four-line-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0;
}
.four-line-row {
  position: relative;
  height: 54px;
  width: 100%;
  border-top: 2px solid #EF4444;    /* Headline (Red) */
  border-bottom: 2px solid #EF4444; /* Lowerline (Red) */
  background: white;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
}
.four-line-row::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 0;
  border-top: 1.5px dashed #3B82F6; /* Midline (Blue dashed) */
  pointer-events: none;
}
.four-line-row::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 0;
  border-top: 2px solid #3B82F6;    /* Baseline (Blue solid) */
  pointer-events: none;
}

.four-line-gutter {
  width: 68px;
  border-right: 2px solid #EF4444; /* Vertical red margin */
  background: #FFF8F8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.four-line-gutter .gutter-num {
  font-size: 0.8rem;
  font-weight: 900;
  color: #B91C1C;
  line-height: 1;
}
.four-line-gutter .gutter-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #475569;
  line-height: 1.1;
  text-transform: uppercase;
  margin-top: 2px;
}

.four-line-slots {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 0 8px;
}

.four-line-chars {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  width: 100%;
  font-size: 2.2rem;
  font-weight: bold;
  letter-spacing: 12px;
}

.four-line-cell {
  position: relative;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trace-char-model {
  font-size: 2.25rem;
  font-weight: 900;
  color: #0F172A;
  line-height: 1;
  font-family: 'Nunito', 'Baloo 2', system-ui, sans-serif;
}
.trace-char-dotted {
  font-size: 2.25rem;
  font-weight: 900;
  color: #94A3B8;
  line-height: 1;
  letter-spacing: 1px;
  font-family: 'Nunito', 'Baloo 2', system-ui, sans-serif;
}
.trace-start-dot {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  z-index: 3;
}

.four-line-words {
  justify-content: space-around;
}
.four-line-word-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #1E293B;
  font-family: 'Nunito', 'Baloo 2', system-ui, sans-serif;
}
.four-line-word-cell .word-lead {
  color: #4338CA;
  font-weight: 900;
}
.four-line-word-cell .word-text {
  color: #0F172A;
}

/* 7. HINDI NOTEBOOK GRID (स्वर और व्यंजन) */
.hindi-grid-notebook {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 10px 0;
}
.hindi-trace-box {
  border: 2px solid #1E293B;
  border-radius: 12px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #FAFAFA;
}
.hindi-trace-box .guide-head {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748B;
}
.hindi-trace-char {
  font-size: 2.8rem;
  font-weight: 900;
  color: #475569;
  letter-spacing: 2px;
}
.hindi-trace-dotted {
  font-size: 2.8rem;
  color: #94A3B8;
  opacity: 0.85;
}

/* HINDI FULL-PAGE 2-LINE NOTEBOOK RULING */
.hindi-page-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.hindi-note-row {
  position: relative;
  height: 54px;
  width: 100%;
  border-top: 2px solid #1E293B;    /* Top Headline / शिरोरेखा */
  border-bottom: 2px solid #1E293B; /* Bottom Baseline / आधार रेखा */
  background: white;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
}
.hindi-gutter {
  width: 68px;
  border-right: 2px solid #EF4444; /* Vertical red margin line */
  background: #FFF8F8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.hindi-gutter .gutter-num {
  font-size: 0.8rem;
  font-weight: 900;
  color: #B91C1C;
  line-height: 1;
}
.hindi-gutter .gutter-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #475569;
  line-height: 1.1;
  text-transform: uppercase;
  margin-top: 2px;
}
.hindi-slots {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 0 8px;
}
.hindi-cell {
  position: relative;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hindi-char-model {
  font-size: 2.3rem;
  font-weight: 900;
  color: #0F172A;
  line-height: 1;
  font-family: 'Baloo 2', system-ui, sans-serif;
}
.hindi-char-dotted {
  font-size: 2.3rem;
  font-weight: 900;
  color: #94A3B8;
  line-height: 1;
  font-family: 'Baloo 2', system-ui, sans-serif;
}
.hindi-start-dot {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  z-index: 3;
}
.hindi-word-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #1E293B;
  font-family: 'Baloo 2', system-ui, sans-serif;
}

/* MATH SQUARE BOX NOTEBOOK RULING (चौखाने वाली कॉपी) */
.math-grid-row {
  position: relative;
  height: 52px;
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 8px;
  box-sizing: border-box;
}
.math-grid-gutter {
  width: 68px;
  background: #FFF8F8;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  border-right: 2px solid #EF4444;
}
.math-grid-gutter .gutter-num {
  font-size: 0.8rem;
  font-weight: 900;
  color: #B91C1C;
}
.math-grid-gutter .gutter-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
}
.math-grid-slots {
  flex: 1;
  display: flex;
  justify-content: space-around;
  gap: 8px;
}
.math-grid-box {
  flex: 1;
  height: 100%;
  border: 1.5px solid #64748B;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: white;
}
.math-num-model {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0F172A;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
}
.math-num-dotted {
  font-size: 2.2rem;
  font-weight: 900;
  color: #94A3B8;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
}
.math-num-dot {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 6px;
  height: 6px;
  background: #EF4444;
  border-radius: 50%;
}

/* CLOCK 12-GRID */
.clock-12-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 0;
}
.clock-card-compact {
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
}

/* PRE-WRITING LINE TRACING FULL PAGE */
.line-tracing-full-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0;
  flex: 1;
  justify-content: space-around;
}
.line-trace-row-full {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
}
.line-trace-row-full svg {
  flex: 1;
  height: 40px;
}
.line-trace-row-full svg path {
  fill: none;
  stroke: #64748B;
  stroke-width: 3.5;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
}

/* TABLE 4-COLUMN GRID */
.table-4col-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 6px 0;
  flex: 1;
}

/* 8. DRAWING & COLORING ART */
.drawing-step-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 10px 0;
}
.draw-step-card {
  border: 2px solid #1E293B;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 170px;
}
.draw-step-card h4 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #1E293B;
}
.draw-step-svg {
  flex: 1;
  width: 100%;
  max-height: 120px;
}

/* ═════════════════════════════════════════════════════════════════════
   CATEGORY BUNDLE CARDS & MULTI-PAGE BOOKLETS
   ═════════════════════════════════════════════════════════════════════ */
.ws-bundles-section {
  max-width: 1400px;
  margin: 20px auto 26px;
  padding: 0 20px;
}
.ws-bundles-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #1E293B;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-bundle-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 14px;
  scrollbar-width: thin;
}
.bundle-tab {
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  background: white;
  color: #475569;
  border: 1.5px solid #CBD5E1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.bundle-tab:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #1E293B;
}
.bundle-tab.active {
  background: #4F46E5;
  color: white;
  border-color: #4338CA;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.a4-bundle-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border: none;
}
.ws-category-bundle-banner {
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border: 2px dashed #6366F1;
  border-radius: 14px;
  padding: 12px 18px;
  margin: 14px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.ws-category-bundle-banner .banner-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #312E81;
}
.ws-category-bundle-banner .banner-btn {
  background: #4F46E5;
  color: white;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
  transition: all 0.2s;
}
.ws-category-bundle-banner .banner-btn:hover {
  background: #4338CA;
  transform: translateY(-1px);
}
.ws-bundles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.ws-bundle-card {
  background: white;
  border-radius: 16px;
  border: 2px solid #E2E8F0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.ws-bundle-card:hover {
  transform: translateY(-3px);
  border-color: #6366F1;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.16);
}
.ws-bundle-card-icon {
  font-size: 2.6rem;
  background: #EEF2FF;
  border-radius: 12px;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ws-bundle-card-body h4 {
  font-size: 1rem;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 2px;
}
.ws-bundle-card-body p {
  font-size: 0.78rem;
  color: #64748B;
  font-weight: 700;
  margin-bottom: 6px;
}
.ws-bundle-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  color: #92400E;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #FDE68A;
}

/* ── Cover Page Styling ── */
.a4-cover-page {
  text-align: center;
  justify-content: space-around !important;
  background: #FFFBEB !important;
}
.cover-crest {
  font-size: 4.5rem;
  margin-bottom: 6px;
}
.cover-main-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1E1B4B;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cover-sub-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #4F46E5;
  margin-bottom: 24px;
}
.cover-student-box {
  background: white;
  border: 2px dashed #1E293B;
  border-radius: 16px;
  padding: 18px 24px;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 2.2;
}
.cover-student-box span.val {
  border-bottom: 2px solid #0F172A;
  padding: 0 10px;
  font-weight: 900;
  color: #4338CA;
}

/* ── Certificate Page Styling ── */
.a4-cert-page {
  background: #F8FAFC !important;
  text-align: center;
  justify-content: space-around !important;
}
.cert-crest {
  font-size: 4.5rem;
  margin-bottom: 4px;
}
.cert-header {
  font-size: 2.4rem;
  font-weight: 900;
  color: #92400E;
  letter-spacing: 1px;
}
.cert-award-text {
  font-size: 1.1rem;
  color: #475569;
  font-weight: 700;
  margin: 10px 0;
}
.cert-child-name {
  font-size: 2.4rem;
  font-weight: 900;
  color: #1E1B4B;
  text-decoration: underline;
  margin: 10px 0;
}
.cert-signatures {
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  font-weight: 800;
  font-size: 0.95rem;
}

/* ── Floating Back to Top Button ── */
.ws-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: #4F46E5;
  color: white;
  border: 2px solid white;
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-back-to-top:hover {
  background: #4338CA;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5);
}

/* ── Modern Footer Section ── */
.ws-footer {
  background: #0F172A;
  color: #E2E8F0;
  padding: 50px 20px 30px;
  margin-top: 60px;
  border-top: 4px solid #4F46E5;
}
.ws-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 40px;
}
.footer-col h3 {
  font-size: 1.25rem;
  font-weight: 900;
  color: white;
  margin-bottom: 12px;
}
.footer-col h4 {
  font-size: 1.05rem;
  font-weight: 900;
  color: #93C5FD;
  margin-bottom: 14px;
}
.footer-col p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #94A3B8;
  margin-bottom: 6px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: color 0.15s;
}
.footer-col ul li a:hover {
  color: #FCD34D;
}

/* ── Responsive Breakpoints ── */
@media screen and (max-width: 900px) {
  .ws-nav-container {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .ws-nav-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .ws-footer-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .ws-kid-bar {
    border-radius: 20px;
    padding: 12px 14px;
  }
}

@media screen and (max-width: 640px) {
  .ws-hero h2 {
    font-size: 1.5rem;
  }
  .ws-hero p {
    font-size: 0.9rem;
  }
  .ws-subfilter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ws-search-box {
    max-width: 100%;
  }
  .ws-diff-group {
    justify-content: center;
  }
  .ws-studio-toolbar {
    padding: 6px 10px;
    gap: 6px;
    top: 6px;
    width: 96vw;
  }
  .toolbar-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .ws-bundles-grid {
    grid-template-columns: 1fr;
  }
  .ws-sheet-grid {
    grid-template-columns: 1fr;
  }
}

/* ═════════════════════════════════════════════════════════════════════
   PRINT MEDIA RULES — PERFECT CLEAN 1-PAGE & MULTI-PAGE A4 PRINT
   ═════════════════════════════════════════════════════════════════════ */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 8mm 8mm 8mm;
  }

  html, body {
    background: white !important;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide entire screen UI */
  .ws-navbar,
  .ws-hero,
  .ws-subfilter-row,
  .ws-bundles-section,
  .ws-catalog-wrap,
  .ws-studio-toolbar,
  .ws-footer,
  .ws-back-to-top,
  footer,
  button,
  .no-print {
    display: none !important;
  }

  .a4-bundle-container {
    width: 100% !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Make modal container transparent and static */
  .ws-studio-modal {
    position: static !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  /* Print Paper specs */
  .a4-page-paper {
    width: 100% !important;
    min-height: 275mm !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 0 0 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: white !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-bundle-container > .a4-page-paper:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .a4-paper-inner-frame {
    border: 2px solid black !important;
    min-height: 270mm !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
  }

  /* Cover & Certificate backgrounds in print */
  .a4-cover-page .a4-paper-inner-frame,
  .a4-cert-page .a4-paper-inner-frame {
    background: #FFFBEB !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-brand-badge {
    background: #FFFBEB !important;
    border-color: #000 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .match-dot,
  .alpha-badge-circle .dot-left,
  .alpha-badge-circle .dot-right {
    background: black !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Four-line notebook red & blue rulings crisp in print */
  .four-line-row {
    border-top-color: #EF4444 !important;
    border-bottom-color: #EF4444 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .four-line-row::before {
    border-top-color: #3B82F6 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .four-line-row::after {
    border-top-color: #3B82F6 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .four-line-gutter {
    border-right-color: #EF4444 !important;
    background-color: #FFF5F5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .trace-start-dot {
    background-color: #EF4444 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .trace-char-dotted {
    color: #94A3B8 !important;
  }
  .trace-char-model {
    color: #0F172A !important;
  }
}

/* ===== Phones: compact header + one swipeable row per filter ===== */
@media screen and (max-width: 640px) {
  .ws-navbar { padding-top: 8px; padding-bottom: 8px; }
  .ws-nav-actions {
    flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 8px; width: 100%;
  }
  .ws-class-pills, .ws-subject-bar {
    flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  }
  .ws-nav-actions::-webkit-scrollbar,
  .ws-class-pills::-webkit-scrollbar,
  .ws-subject-bar::-webkit-scrollbar { display: none; }
  .ws-nav-actions > *, .ws-class-pills > *, .ws-subject-bar > * { flex-shrink: 0; }
}

/* Name not filled in yet → print a blank line to write on by hand */
.field-val:empty, .val:empty {
  display: inline-block; min-width: 150px; height: 1em;
  border-bottom: 1.5px solid #94A3B8; vertical-align: bottom;
}
