/* ==========================================================================
   ADIC PROOFREAD STUDIO - PREMIUM DESIGN SYSTEM
   Supports Latin, Kokila, and Devanagari Scripts
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-border: #c7d2fe;

  --success: #16a34a;
  --success-hover: #15803d;
  --success-soft: #dcfce7;
  --success-border: #86efac;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fee2e2;
  --danger-border: #fca5a5;

  --warning: #d97706;
  --warning-soft: #fef3c7;
  --warning-border: #fcd34d;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-hindi: "Kokila", "Noto Sans Devanagari", "Mangal", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   RED CUT LINE & GREEN ADDITION LINE (CORE REQUIREMENT)
   ========================================================================== */

/* Red Cut Line for Deleted / Replaced Text (User Specification: No color box, pure red cut text, exact same font size) */
del.diff-del,
del.diff-cut,
.diff-removed {
  background: transparent !important;
  background-color: transparent !important;
  color: #dc2626 !important;
  text-decoration: line-through !important;
  text-decoration-color: #dc2626 !important;
  text-decoration-thickness: 1.5px !important;
  -webkit-text-decoration-color: #dc2626 !important;
  -webkit-text-decoration-line: line-through !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  display: inline !important;
  vertical-align: baseline !important;
}

/* Green Line for Added / Inserted Text (User Specification: No color box, pure green underlined text, exact same font size) */
ins.diff-ins,
ins.diff-add,
.diff-added {
  background: transparent !important;
  background-color: transparent !important;
  color: #16a34a !important;
  text-decoration: underline !important;
  text-decoration-color: #16a34a !important;
  text-decoration-thickness: 1.5px !important;
  -webkit-text-decoration-color: #16a34a !important;
  -webkit-text-decoration-line: underline !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  display: inline !important;
  vertical-align: baseline !important;
}

del.diff-del + ins.diff-ins,
del.diff-cut + ins.diff-add {
  margin-left: 2px !important;
}

/* Yellow Highlighter for Proofreader Mentions / Observations */
mark.diff-yellow,
.diff-yellow,
.diff-yellow-highlight {
  background: #fef08a !important; /* vivid fluorescent yellow */
  color: #713f12 !important;
  border-bottom: 2.5px solid #ca8a04 !important;
  padding: 2px 5px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(234, 179, 8, 0.6) !important;
  margin: 0 1px !important;
  display: inline !important;
}

.diff-yellow-note {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #facc15 !important;
  border-radius: 4px !important;
  padding: 2px 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  margin-left: 6px !important;
  vertical-align: middle !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* Hindi text styling */
.hindi-text, [lang="hi"], .devanagari {
  font-family: var(--font-hindi);
  font-size: 1.08em;
  line-height: 1.6;
}

/* ==========================================================================
   NAVBAR & HEADER
   ========================================================================== */

.studio-navbar {
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.brand-badge {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.nav-badge-pending {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

/* ==========================================================================
   HERO & STATS CARDS
   ========================================================================== */

.hero-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}

.hero-desc {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 600px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

/* ==========================================================================
   TABS & FILTER BAR
   ========================================================================== */

.filter-bar {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.category-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-box-wrapper {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

/* ==========================================================================
   DOCUMENT CARDS & TABLE
   ========================================================================== */

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.doc-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.doc-category-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
}

.pill-papers {
  background: #ede9fe;
  color: #6d28d9;
}

.pill-syllabus {
  background: #e0f2fe;
  color: #0369a1;
}

.pill-tlf {
  background: #fef3c7;
  color: #b45309;
}

.doc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.doc-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.doc-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.subjects-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1.25rem;
}

.subject-chip {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.doc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  pt: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-outline {
  background: white;
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-subtle);
}

.hero-banner .btn-outline,
.subcat-active-banner .btn-outline,
.admin-vis-banner .btn-outline,
.pdf-sticky-toolbar .btn-outline,
.bundle-header-card .btn-outline {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.hero-banner .btn-outline:hover,
.subcat-active-banner .btn-outline:hover,
.admin-vis-banner .btn-outline:hover,
.pdf-sticky-toolbar .btn-outline:hover,
.bundle-header-card .btn-outline:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* ==========================================================================
   PROOFREADER WORKSPACE
   ========================================================================== */

.workspace-header {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.reviewer-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.reviewer-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.reviewer-info-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.reviewer-info-subject {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
}

/* Subject Filter Pills */
.subject-nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px 0;
  margin-bottom: 1rem;
}

.sub-pill-btn {
  background: white;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.sub-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sub-pill-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==========================================================================
   QUESTION CARD (PROOFREADER VIEW)
   ========================================================================== */

.question-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.question-card:hover {
  box-shadow: var(--shadow-md);
}

.question-card.has-changes {
  border-left: 4px solid var(--warning);
}

.question-card-header {
  background: #f8fafc;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.q-badge {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}

.q-subject-tag {
  background: #e2e8f0;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: #475569;
}

.question-card-body {
  padding: 18px 22px;
}

.instruction-box {
  background: #f1f5f9;
  border-left: 3px solid #64748b;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #334155;
  margin-bottom: 14px;
  font-style: italic;
}

.passage-box {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 0.92rem;
  color: #78350f;
  margin-bottom: 16px;
  line-height: 1.6;
}

.q-text-content {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.55;
}

.q-image-container {
  margin: 12px 0 18px 0;
  text-align: center;
  background: #f8fafc;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.q-image-container img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.option-item {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ffffff;
  transition: all 0.15s;
}

.option-item.is-correct {
  border-color: var(--success);
  background: #f0fdf4;
}

.option-letter {
  font-weight: 800;
  color: var(--text-muted);
  min-width: 24px;
}

.option-item.is-correct .option-letter {
  color: var(--success);
}

.option-text-val {
  flex: 1;
  font-size: 0.95rem;
}

/* ==========================================================================
   EDIT DRAWER / MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  border: 1px solid var(--border-light);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* ==========================================================================
   ADMIN 1-BY-1 REVIEW CARDS
   ========================================================================== */

.admin-session-box {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  overflow: hidden;
}

.admin-session-header {
  background: #f8fafc;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.change-review-card {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color 0.15s;
}

.change-review-card.status-approved {
  background: rgba(22, 163, 74, 0.04);
  border-left: 4px solid var(--success);
}

.change-review-card.status-rejected {
  background: rgba(220, 38, 38, 0.03);
  border-left: 4px solid var(--danger);
  opacity: 0.7;
}

.diff-display-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 1rem;
  line-height: 1.6;
}

.change-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  animation: slide-in 0.25s ease forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


/* ==========================================================================
   ACTUAL A4 PDF VIEWER & LIVE IN-PLACE EDITING STYLES
   ========================================================================== */

@font-face {
  font-family: 'Kokila';
  src: url('/static/fonts/kokila.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Kokila';
  src: url('/static/fonts/kokilab.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

.pdf-workspace-container {
  background: #334155;
  min-height: calc(100vh - 65px);
  padding: 24px 12px 60px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.pdf-sticky-toolbar {
  position: sticky;
  top: 55px;
  z-index: 95;
  background: #1e293b;
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1200px;
  width: 95%;
  margin-bottom: 24px;
}

.pdf-a4-sheet {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  margin: 0 auto 32px auto;
  padding: 16mm 14mm 16mm 14mm;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
  box-sizing: border-box;
  position: relative;
  font-family: 'Kokila', 'Noto Sans Devanagari', -apple-system, serif;
  color: #111827;
  line-height: 1.4;
  page-break-after: always;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

.pdf-page-top-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.pdf-page-top-title {
  font-weight: 800;
  font-size: 13pt;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0f172a;
}

.pdf-page-top-sec {
  font-weight: 700;
  font-size: 10pt;
  background: #1e293b;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.pdf-page-footer-band {
  position: absolute;
  bottom: 8mm;
  left: 14mm;
  right: 14mm;
  border-top: 1px solid #cbd5e1;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9pt;
  color: #64748b;
  font-weight: 600;
}

.pdf-q-box {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e2e8f0;
  position: relative;
  transition: background-color 0.15s;
}

.pdf-q-box:last-child {
  border-bottom: none;
}

.pdf-q-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13pt;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.pdf-q-no {
  font-weight: 800;
  color: #1d4ed8;
  min-width: 26px;
}

.pdf-q-instruction {
  background: #f8fafc;
  border-left: 3px solid #64748b;
  padding: 6px 10px;
  font-size: 10.5pt;
  font-style: italic;
  color: #334155;
  margin-bottom: 8px;
  border-radius: 2px;
}

.pdf-q-passage {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 8px 12px;
  font-size: 11pt;
  color: #78350f;
  margin-bottom: 10px;
  line-height: 1.5;
  border-radius: 2px;
}

.pdf-q-diagram {
  text-align: center;
  margin: 6px 0 10px 0;
}

.pdf-q-diagram img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.pdf-options-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
  margin-top: 6px;
}

.pdf-opt-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5pt;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background-color 0.1s;
}

.pdf-opt-letter {
  font-weight: 800;
  color: #475569;
  min-width: 22px;
}

.pdf-opt-item.is-key .pdf-opt-letter {
  color: #16a34a;
}

/* ==========================================================================
   LIVE CLICK-TO-EDIT INTERACTION ON PDF PAGES
   ========================================================================== */

.live-pdf-edit {
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 3px;
  transition: background-color 0.12s, outline 0.12s;
  display: inline;
}

.live-pdf-edit:hover {
  background-color: rgba(99, 102, 241, 0.09) !important;
  outline: 1.5px dashed #6366f1 !important;
}

.live-inline-active {
  background-color: #ffffff !important;
  outline: 2px solid #4f46e5 !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
  border-radius: 4px !important;
  padding: 4px 6px !important;
  display: block !important;
}

.live-edit-action-bar {
  position: absolute;
  top: -36px;
  right: 0;
  background: #0f172a;
  color: white;
  border-radius: 6px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 100;
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
}

/* View Mode: Clean Print View */
.view-mode-clean del.diff-del {
  display: none !important;
}
.view-mode-clean ins.diff-ins {
  background: none !important;
  color: inherit !important;
  text-decoration: none !important;
  border: none !important;
  padding: 0 !important;
}

/* View Mode: Original View */
.view-mode-original ins.diff-ins {
  display: none !important;
}
.view-mode-original del.diff-del {
  background: none !important;
  color: inherit !important;
  text-decoration: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Print Media for Physical A4 Printing */
@media print {
  .studio-navbar, .pdf-sticky-toolbar, .toast-container {
    display: none !important;
  }
  .pdf-workspace-container {
    background: transparent !important;
    padding: 0 !important;
  }
  .pdf-a4-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    page-break-after: always !important;
  }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE LAYOUT (DOES NOT AFFECT DESKTOP OR PRINT)
   ========================================================================== */
@media screen and (max-width: 768px) {
  .studio-navbar {
    padding: 0.65rem 0.9rem;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-container {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .brand-badge {
    padding: 4px 8px;
    font-size: 0.72rem;
    flex-shrink: 0;
  }
  .brand-title {
    font-size: 1rem;
    line-height: 1.2;
  }
  .brand-subtitle {
    display: none;
  }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }
  .nav-link {
    padding: 5px 10px;
    font-size: 0.82rem;
  }
  .main-content {
    padding: 1rem 0.75rem 3.5rem 0.75rem;
  }
  .hero-banner {
    padding: 1.15rem 1rem;
    margin-bottom: 1.15rem;
    gap: 0.9rem;
  }
  .hero-title {
    font-size: 1.28rem;
  }
  .hero-desc {
    font-size: 0.85rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .stat-card {
    padding: 0.9rem 1rem;
  }
  .stat-value {
    font-size: 1.45rem;
  }
  .filter-bar {
    padding: 0.8rem;
    gap: 0.75rem;
  }
  .category-tabs {
    width: 100%;
    flex-wrap: wrap;
  }
  .tab-btn {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: 0.8rem;
    text-align: center;
  }
  .search-box-wrapper {
    min-width: 0;
    width: 100%;
  }
  .search-input,
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px;
  }
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .doc-card {
    padding: 1rem;
  }
  .doc-header,
  .doc-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .doc-actions {
    padding-top: 0.75rem;
  }
  .modal-card {
    width: 95%;
    max-height: 92dvh;
    padding: 1.15rem;
  }
  .modal-title {
    font-size: 1.1rem;
  }
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    width: 100%;
  }
}
