/* ========================================================
   LiveClass AI - High Contrast & Eye-Friendly Stylesheet
   ======================================================== */

.hidden {
  display: none !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.animate-shake {
  animation: shake 0.35s ease-in-out;
}

/* App Gate Keypad Styles (ปุ่มตัวเลข 1-9 และแป้นควบคุม) */
.gate-numpad-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s ease, border-color 0.15s ease;
}
.gate-numpad-btn:active {
  transform: scale(0.92);
}

/* Root & Theme Variables */
:root {
  --font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ========================================================
   1. LIGHT THEME (พื้นสีขาว ตัวหนังสือสีดำ สบายตา อ่านง่าย คมชัด)
   ======================================================== */
html.theme-light,
html:not(.theme-dark) {
  color-scheme: light;
}

html.theme-light body,
html:not(.theme-dark) body {
  background-color: #f8fafc !important; /* Soft warm paper white */
  color: #0f172a !important; /* Crisp black/slate text */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Header & Toolbars */
html.theme-light header {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

html.theme-light header h1 {
  color: #0f172a !important;
}

html.theme-light section {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Main workspace containers & panels */
html.theme-light .lg\:col-span-7,
html.theme-light .lg\:col-span-5 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

html.theme-light .bg-slate-900,
html.theme-light .bg-slate-900\/60,
html.theme-light .bg-slate-900\/80,
html.theme-light .bg-slate-900\/90,
html.theme-light .bg-slate-900\/95 {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html.theme-light .bg-slate-950,
html.theme-light .bg-slate-950\/40,
html.theme-light .bg-slate-950\/60,
html.theme-light .bg-slate-950\/80 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Slate Buttons & Neutral Controls */
html.theme-light .bg-slate-800,
html.theme-light .bg-slate-800\/60,
html.theme-light .bg-slate-800\/80 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.theme-light .bg-slate-800:hover,
html.theme-light .hover\:bg-slate-700:hover {
  background-color: #e2e8f0 !important;
  color: #000000 !important;
}

/* Text Colors */
html.theme-light .text-white,
html.theme-light .text-slate-100,
html.theme-light .text-slate-200 {
  color: #0f172a !important; /* Black font for maximum clarity */
}

html.theme-light .text-slate-300 {
  color: #1e293b !important;
}

html.theme-light .text-slate-400 {
  color: #475569 !important; /* High-contrast readable gray */
}

html.theme-light .text-slate-500 {
  color: #64748b !important;
}

html.theme-light .border-slate-800,
html.theme-light .border-slate-700,
html.theme-light .border-slate-700\/60,
html.theme-light .border-slate-700\/80 {
  border-color: #e2e8f0 !important;
}

/* Inputs, Selects, and Dropdowns */
html.theme-light input,
html.theme-light select,
html.theme-light textarea {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.theme-light input::placeholder,
html.theme-light textarea::placeholder {
  color: #94a3b8 !important;
}

html.theme-light #demoMenuDropdown {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
}

html.theme-light #demoMenuDropdown button {
  color: #0f172a !important;
  border-color: #f1f5f9 !important;
}

html.theme-light #demoMenuDropdown button:hover {
  background-color: #f1f5f9 !important;
}

/* Visualizer & VU Meter */
html.theme-light #visualizerContainer {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

html.theme-light #visualizerContainer .w-16.h-2 {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

/* File Upload Drawer */
html.theme-light #fileUploadSection {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.theme-light #fileUploadSection label {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

html.theme-light #filePlayerContainer {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Interim Live Speaking Indicator */
html.theme-light #interimContainer {
  background: linear-gradient(to right, #f0f9ff, #ffffff) !important;
  border-color: #bae6fd !important;
}

html.theme-light #interimEnglish {
  color: #000000 !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
}

/* Transcript Cards (รายการข้อความและคำแปล) */
html.theme-light div[id^="transcript-"] {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

html.theme-light div[id^="transcript-"]:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06) !important;
}

/* English Text in Transcripts: Black & Crisp */
html.theme-light div[id^="transcript-"] .text-slate-100,
html.theme-light div[id^="transcript-"] .font-medium.text-slate-100 {
  color: #000000 !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
}

/* Thai Phonetics Reading Box (คำอ่านไทย: พื้นเขียวอ่อน ตัวหนังสือเขียวเข้ม ชัดเจน สบายตา) */
html.theme-light .bg-emerald-950\/50,
html.theme-light .bg-emerald-950\/60,
html.theme-light .bg-emerald-950\/70,
html.theme-light #interimPhoneticsBox,
html.theme-light #latestQuestionPhoneticsBox {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
}

html.theme-light .bg-emerald-950\/50 span,
html.theme-light .bg-emerald-950\/60 span,
html.theme-light .bg-emerald-950\/70 span,
html.theme-light .text-emerald-100,
html.theme-light .text-emerald-200,
html.theme-light .text-emerald-300 {
  color: #064e3b !important;
  font-weight: 700 !important;
}

/* Karaoke English Reading Box (คาราโอเกะ: พื้นม่วงอ่อน ตัวหนังสือม่วงเข้ม คมชัด) */
html.theme-light .bg-fuchsia-950\/30,
html.theme-light .bg-fuchsia-950\/40,
html.theme-light .bg-fuchsia-950\/50,
html.theme-light #interimKaraokeBox,
html.theme-light #latestQuestionKaraokeBox {
  background-color: #fdf4ff !important;
  border-color: #f0abfc !important;
}

html.theme-light .bg-fuchsia-950\/30 span,
html.theme-light .bg-fuchsia-950\/40 span,
html.theme-light .bg-fuchsia-950\/50 span,
html.theme-light .text-fuchsia-100,
html.theme-light .text-fuchsia-200,
html.theme-light .text-fuchsia-300 {
  color: #581c87 !important;
  font-weight: 700 !important;
}

/* Thai Translation Box (แปลไทย: พื้นฟ้าอ่อน ตัวหนังสือน้ำเงินเข้ม ชัดเจน) */
html.theme-light .bg-cyan-950\/20,
html.theme-light .bg-cyan-950\/30,
html.theme-light .bg-cyan-950\/60,
html.theme-light #interimThaiBox,
html.theme-light #latestQuestionThaiBox {
  background-color: #f0f9ff !important;
  border-color: #bae6fd !important;
}

html.theme-light .bg-cyan-950\/20 span,
html.theme-light .bg-cyan-950\/30 span,
html.theme-light .bg-cyan-950\/60 span,
html.theme-light .text-cyan-100,
html.theme-light .text-cyan-200,
html.theme-light .text-cyan-300 {
  color: #0c4a6e !important;
  font-weight: 600 !important;
}

/* Teacher Question Detected Card */
html.theme-light .question-detected-card,
html.theme-light .bg-gradient-to-r.from-amber-950\/30 {
  background: linear-gradient(to right, #fffbeb, #ffffff) !important;
  border-color: #f59e0b !important;
}

html.theme-light .text-amber-300,
html.theme-light .text-amber-200,
html.theme-light .text-amber-400 {
  color: #78350f !important;
}

html.theme-light #latestQuestionBox {
  background-color: #fffbeb !important;
  border-color: #fde68a !important;
  color: #000000 !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
}

/* AI Suggested Answers Cards */
html.theme-light #answersContainer > div {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

html.theme-light #answersContainer > div .bg-slate-950\/80 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #000000 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
}

/* Modals (หน้าต่างป๊อปอัปทั้งหมด: พื้นขาว ตัวหนังสือดำ ชัดเจน) */
html.theme-light #settingsModal > div,
html.theme-light #tabAudioGuideModal > div,
html.theme-light #externalMicGuideModal > div,
html.theme-light #micTestModal > div {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

html.theme-light #settingsModal h3,
html.theme-light #tabAudioGuideModal h3,
html.theme-light #externalMicGuideModal h3,
html.theme-light #micTestModal h3 {
  color: #0f172a !important;
}

html.theme-light #micTestModal .bg-slate-950 {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

html.theme-light #testModalSpeechResult {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Custom Scrollbars in Light Mode */
html.theme-light ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html.theme-light ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
html.theme-light ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========================================================
   2. DARK THEME (สำหรับผู้ใช้ที่ต้องการเปิดใช้งานตอนกลางคืน)
   ======================================================== */
html.theme-dark {
  color-scheme: dark;
}

html.theme-dark ::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
html.theme-dark ::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.8);
  border-radius: 9999px;
}
html.theme-dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 1);
}

/* Animations & Effects */
@keyframes questionGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25), inset 0 0 10px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.7);
  }
  50% {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45), inset 0 0 15px rgba(245, 158, 11, 0.2);
    border-color: rgba(251, 191, 36, 1);
  }
}

.question-detected-card {
  animation: questionGlow 2s infinite ease-in-out;
}

@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-entry {
  animation: fadeInSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Selection Highlight */
html.theme-light ::selection {
  background-color: #38bdf8;
  color: #000000;
}

/* ========================================================
   3. DYNAMIC FONTS & FONT SIZES
   ======================================================== */
:root {
  --app-font: 'Prompt', sans-serif;
  --transcript-font-size: 16px;
}

body, html, 
body input, body button, body select, body textarea,
#transcriptList, #answersContainer, #mainWorkspace, .font-sans {
  font-family: var(--app-font) !important;
}

/* Font Class Overrides */
.font-prompt { font-family: 'Prompt', sans-serif !important; }
.font-sarabun { font-family: 'Sarabun', sans-serif !important; }
.font-kanit { font-family: 'Kanit', sans-serif !important; }
.font-mitr { font-family: 'Mitr', sans-serif !important; }
.font-chakra { font-family: 'Chakra Petch', sans-serif !important; }
.font-inter { font-family: 'Inter', sans-serif !important; }
.font-roboto { font-family: 'Roboto', sans-serif !important; }

/* Dynamic Font Sizing for Transcripts and Answers */
#transcriptList .transcript-english-text,
#transcriptList div[id^="transcript-"] .text-slate-100,
#transcriptList div[id^="transcript-"] .font-medium.text-slate-100 {
  font-size: var(--transcript-font-size) !important;
  line-height: 1.55 !important;
}

#transcriptList .phonetics-thai-text,
#transcriptList .phonetics-row {
  font-size: calc(var(--transcript-font-size) * 0.88) !important;
}

#transcriptList .thai-content {
  font-size: calc(var(--transcript-font-size) * 0.94) !important;
}

/* Bookmark Star Animation */
.bookmark-star-btn.bookmarked i,
.bookmark-star-btn.bookmarked svg {
  fill: #f59e0b !important;
  color: #f59e0b !important;
}

/* Layout Transition */
#leftPaneContainer, #rightPaneContainer {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PDF Print Document Styling */
.pdf-document {
  font-family: 'Sarabun', 'Prompt', sans-serif;
  color: #0f172a;
  background-color: #ffffff;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}
.pdf-table th {
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
  font-size: 11px;
}
.pdf-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 11px;
  vertical-align: top;
}

/* ========================================================
   Dog Mascots Decorating Empty Background Left & Right
   ======================================================== */
@keyframes dogFloatLeft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes dogFloatRight {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.animate-dog-left {
  animation: dogFloatLeft 3.2s ease-in-out infinite;
}

.animate-dog-right {
  animation: dogFloatRight 3.2s ease-in-out infinite;
}

/* Side Gutter Floating Cards (ในพื้นที่ว่างซ้ายและขวาของหน้าจอ) */
.side-gutter-decor {
  position: fixed;
  top: 105px;
  z-index: 20;
  pointer-events: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Wide Screens (>= 1720px): Full 210px width */
@media (min-width: 1720px) {
  .side-gutter-left {
    right: calc(50% + 655px);
    width: 210px;
    display: block !important;
  }
  .side-gutter-right {
    left: calc(50% + 655px);
    width: 210px;
    display: block !important;
  }
}

/* Medium Widescreens (1480px - 1719px): Compact 145px width */
@media (min-width: 1480px) and (max-width: 1719px) {
  .side-gutter-left {
    right: calc(50% + 648px);
    width: 145px;
    display: block !important;
  }
  .side-gutter-right {
    left: calc(50% + 648px);
    width: 145px;
    display: block !important;
  }
}

/* Screens < 1480px: Hide floating side gutter cards so they don't cover workspace */
@media (max-width: 1479px) {
  .side-gutter-decor {
    display: none !important;
  }
}

/* Ambient Side Wallpaper Fades (แสดงในพื้นหลังว่าง ๆ ซ้ายและขวา สวยงามกลมกลืน) */
.ambient-side-bg-left {
  position: fixed;
  top: 80px;
  bottom: 40px;
  left: 0;
  width: min(300px, calc(50vw - 420px));
  background-image: url('assets/images/dog_left_portrait.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  opacity: 0.22;
  filter: blur(0.5px);
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 0;
}

.ambient-side-bg-right {
  position: fixed;
  top: 80px;
  bottom: 40px;
  right: 0;
  width: min(300px, calc(50vw - 420px));
  background-image: url('assets/images/dog_right_portrait.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  opacity: 0.22;
  filter: blur(0.5px);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  z-index: 0;
}

@media (max-width: 1024px) {
  .ambient-side-bg-left,
  .ambient-side-bg-right {
    display: none !important;
  }
}

/* ========================================================
/* ========================================================
   RESPONSIVE ENHANCEMENTS: MOBILE & PC (ปรับสมบูรณ์แบบ 100%)
   ======================================================== */

/* 1. Mobile Native App Layout (< 1024px) - ยืดทางยาวได้ เต็มจอ นุ่มนวลตามมาตรฐานแอปดัง */
@media (max-width: 1023px) {
  html, body {
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch;
  }

  body {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Sticky App Header at Top with Safe Area */
  header {
    position: sticky !important;
    top: 0 !important;
    flex-shrink: 0 !important;
    padding-top: max(8px, env(safe-area-inset-top)) !important;
    z-index: 40 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }

  /* Compact Stats Bar on Mobile */
  #statsBar {
    position: sticky !important;
    top: 53px !important;
    z-index: 35 !important;
    flex-shrink: 0 !important;
  }

  /* Mobile Tabs Bar */
  #mobileWorkspaceTabs {
    position: sticky !important;
    top: 85px !important;
    z-index: 35 !important;
    flex-shrink: 0 !important;
    padding-top: 4px;
    padding-bottom: 4px;
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(8px) !important;
  }

  /* Main Workspace: ยืดลงข้างล่างได้เต็มที่ เลื่อนอ่านตามความยาวได้อย่างอิสระ */
  #mainWorkspace {
    flex: 1 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 8px 10px 130px 10px !important; /* เว้นที่ด้านล่างให้เลื่อนยาวๆ ไม่ทับแถบล่าง */
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  /* Mobile Pane Switching: แสดงเรียงต่อกันลงตามความยาว (Sequential Stacking) อ่านง่าย ชัดเจน */
  .mobile-pane-hidden {
    display: flex !important;
  }

  #leftPaneContainer,
  #rightPaneContainer {
    width: 100% !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 18px !important;
    margin-bottom: 16px !important;
  }

  /* Transcript List: ยืดความยาวลงข้างล่างตามเนื้อหา ไม่จำกัดความสูง (No inner scroll trap) */
  #transcriptList {
    flex: 1 0 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 260px !important;
    overflow: visible !important;
    padding: 10px 8px 24px 8px !important;
  }

  /* In-Page Dialogue Section on Mobile */
  #inPageDialogueSection {
    flex: 1 0 auto !important;
    width: 100% !important;
    min-height: calc(100vh - 160px) !important;
    overflow: visible !important;
    padding: 8px 10px 96px 10px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  #inPageDialogueSection > div {
    flex: 1 0 auto !important;
    min-height: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 12px !important;
    border-radius: 20px !important;
  }

  #dialogueMessagesList {
    flex: 1 0 auto !important;
    min-height: 350px !important;
    overflow: visible !important;
  }

  /* Prevent iOS Safari auto-zooming on focus by enforcing 16px input font */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Mobile touch target minimum 46-52px for main controls */
  #toggleListenBtn,
  #openLiveDialogueBtn,
  #sideTranslateThToEnBtn,
  #sideSpeechThaiBtn,
  #mobileHeroListenBtn {
    min-height: 48px;
  }

  /* Mobile Readability: คมชัด ตัวหนังสือขนาดใหญ่ สบายตา อ่านง่ายมากในมือถือ */
  #transcriptList .thai-content,
  #interimThaiText {
    font-size: 1.05rem !important; /* ~17px คมชัด ไม่อึดอัด */
    line-height: 1.65 !important;
    font-weight: 600 !important;
    color: #0f172a !important;
  }

  #transcriptList [id^="transcript-"] > .text-sm,
  #interimEnglish {
    font-size: 1.05rem !important; /* ~17px ภาษาอังกฤษตัวหนา ชัดเจน */
    line-height: 1.5 !important;
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  /* Hide footer on mobile for pure native app fullscreen space */
  footer {
    display: none !important;
  }
}

/* Mobile Native Bottom Bar Fixes & Touch Targets */
#mobileNativeBottomBar {
  z-index: 100 !important;
  pointer-events: auto !important;
  user-select: none;
}
#mobileNativeBottomBar button,
#mobileNativeBottomBar a {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
}

/* 2. PC / Desktop Layout Enhancements (>= 1024px) */
@media (min-width: 1024px) {
  .mobile-pane-hidden {
    display: flex !important;
  }

  #mobileNativeBottomBar {
    display: none !important;
  }

  /* Independent scroll for left and right panes on PC */
  #transcriptList {
    max-height: calc(100vh - 215px) !important;
    min-height: calc(100vh - 215px) !important;
    overflow-y: auto;
  }

  #rightPaneContainer {
    max-height: calc(100vh - 215px) !important;
    overflow-y: auto;
    padding-right: 2px;
  }

  /* In-page dialogue section full height on desktop */
  #inPageDialogueSection > div {
    min-height: calc(100vh - 190px) !important;
  }
}
  /* Independent scroll for left and right panes on PC */
  #transcriptList {
    max-height: calc(100vh - 215px) !important;
    min-height: calc(100vh - 215px) !important;
    overflow-y: auto;
  }

  #rightPaneContainer {
    max-height: calc(100vh - 215px) !important;
    overflow-y: auto;
    padding-right: 2px;
  }

  /* In-page dialogue section full height on desktop */
  #inPageDialogueSection > div {
    min-height: calc(100vh - 190px) !important;
  }
}

/* 3. Smooth Fade-in Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn {
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Enhanced PDF Print Engine Styles for Desktop & Mobile */
#pdfExportContainer,
#dialoguePdfContainer {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  width: 794px !important;
  min-width: 794px !important;
  max-width: 794px !important;
  background: #ffffff !important;
  z-index: 999999 !important;
  box-sizing: border-box !important;
}

.pdf-page,
.pdf-page-container {
  width: 794px !important;
  min-width: 794px !important;
  max-width: 794px !important;
  min-height: 1115px !important;
  margin: 0 auto !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  padding: 28px 32px !important;
  font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #0f172a !important;
}

.pdf-item-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 10px;
  box-sizing: border-box;
  page-break-inside: avoid;
  break-inside: avoid;
}



