/* ==========================================================================
   DuoVista PDF Studio - World-Class Architecture & Styling (v2.1.0)
   Created by Shahriyar Sojib Hasan — Free for Students Worldwide
   Responsive for Desktop (Win 10/11, Mac, Linux) & Mobile (Android, iOS, iPad)
   Default: Top & Bottom Split with 2px Hairline Divider & 3-Line Slide Menu
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0284c7;
  --accent-light: #e0f2fe;
  
  --bg-app: #f1f5f9;
  --bg-header: #ffffff;
  --bg-pane: #e2e8f0;
  --bg-card: #ffffff;
  --bg-floating: rgba(255, 255, 255, 0.92);
  --bg-input: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --resizer-color: #cbd5e1;
  --resizer-active: #2563eb;
  
  --pane1-accent: #2563eb;
  --pane2-accent: #7c3aed;
  
  --pdf-page-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  --pdf-filter: none;
  
  --header-height: 44px;
  --drawer-width: 340px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark Mode */
body.theme-dark {
  --bg-app: #090d16;
  --bg-header: #111827;
  --bg-pane: #030712;
  --bg-card: #1f2937;
  --bg-floating: rgba(31, 41, 55, 0.92);
  --bg-input: #374151;
  
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #6b7280;
  
  --border-light: #1f2937;
  --border-medium: #374151;
  --resizer-color: #374151;
  --resizer-active: #38bdf8;
  
  --pdf-page-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  --pdf-filter: invert(0.92) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}

/* Sepia (Eye-Care) */
body.theme-sepia {
  --bg-app: #f4ecd8;
  --bg-header: #ede0c4;
  --bg-pane: #e5d6b8;
  --bg-card: #faf4e6;
  --bg-floating: rgba(250, 244, 230, 0.94);
  --bg-input: #fffdf8;
  
  --text-primary: #433422;
  --text-secondary: #6e5940;
  --text-muted: #a69074;
  
  --border-light: #dfcfaf;
  --border-medium: #caa980;
  --resizer-color: #caa980;
  --resizer-active: #b45309;
  
  --pdf-page-shadow: 0 3px 12px rgba(90, 60, 30, 0.12);
  --pdf-filter: sepia(0.35) brightness(0.98);
}

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

html, body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
  user-select: none;
  display: flex;
  flex-direction: column;
}

/* ==================== Top Header Bar ==================== */
.main-header {
  min-height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  z-index: 100;
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Branding & Creator Badge */
.brand-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
  border-right: 1px solid var(--border-light);
  cursor: pointer;
}

.brand-logo {
  display: flex;
  align-items: center;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.brand-name {
  font-weight: 750;
  font-size: 13px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.creator-badge {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 1px 5px;
  border-radius: 10px;
}

body.theme-dark .creator-badge {
  background-color: rgba(37, 99, 235, 0.25);
  color: #60a5fa;
}

body.theme-sepia .creator-badge {
  background-color: rgba(180, 83, 9, 0.15);
  color: #b45309;
}

/* File Actions & Active Pill */
.file-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  max-width: 150px;
}

.file-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

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

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

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-app);
  border-color: var(--primary);
}

.btn-accent {
  background-color: #7c3aed;
  color: #ffffff;
}

.btn-accent:hover {
  background-color: #6d28d9;
}

.btn-compact {
  padding: 3px 8px;
}

.btn-small {
  padding: 2px 6px;
  font-size: 10px;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Layout Buttons */
.layout-toggle-group, .doc-mode-toggle {
  display: inline-flex;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.layout-btn, .mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.12s ease;
}

.layout-btn:hover, .mode-btn:hover {
  color: var(--text-primary);
}

.layout-btn.active, .mode-btn.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  font-weight: 600;
}

/* Tool Buttons */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.tool-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.tool-btn.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.tool-btn.icon-only {
  padding: 4px 6px;
}

.btn-hamburger {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
  padding: 4px 7px;
}

.btn-hamburger:hover {
  background-color: var(--primary);
  color: #ffffff;
}

body.theme-dark .btn-hamburger {
  background-color: #1e293b;
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Timer */
.exam-timer-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 2px 5px;
  gap: 4px;
}

.timer-display {
  font-weight: 700;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  min-width: 36px;
}

.exam-timer-box.warning .timer-display {
  color: #dc2626;
  animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.timer-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  cursor: pointer;
}

/* ==================== Drawer Backdrop Overlay ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==================== 3-Line Slide-Out Menu Drawer ==================== */
.menu-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: min(var(--drawer-width), 92vw);
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 160;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-drawer.open {
  right: 0;
}

.menu-drawer-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-drawer-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  font-size: 13px;
  color: var(--text-primary);
}

.menu-drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Buy Me A Coffee & Cheer Up Card */
.coffee-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

body.theme-dark .coffee-card {
  background: linear-gradient(135deg, #3f2508 0%, #201303 100%);
  border-color: #92400e;
}

body.theme-sepia .coffee-card {
  background: linear-gradient(135deg, #f7eed9 0%, #ede0be 100%);
  border-color: #d1b88e;
}

.coffee-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 750;
  color: #b45309;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

body.theme-dark .coffee-badge {
  color: #fbbf24;
}

.coffee-text {
  font-size: 11px;
  color: #78350f;
  line-height: 1.4;
}

body.theme-dark .coffee-text {
  color: #fde68a;
}

body.theme-sepia .coffee-text {
  color: #5c3b17;
}

.coffee-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #f59e0b;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11.5px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  margin-top: 4px;
}

.coffee-btn:hover {
  background-color: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

/* Sections inside Menu Drawer */
.menu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dev-quote {
  font-style: italic;
  font-size: 10.5px;
  color: var(--text-secondary);
  border-left: 2px solid var(--primary);
  padding-left: 8px;
  margin-top: 6px;
  line-height: 1.4;
}

.dev-quote cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
  font-size: 9.5px;
  margin-top: 3px;
}

.menu-legal-links {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
}

.menu-legal-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.menu-legal-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Dev Info Box */
.dev-info-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.dev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dev-label {
  color: var(--text-muted);
}

.dev-val {
  color: var(--text-primary);
  font-weight: 600;
}

.badge-ver {
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9.5px;
}

/* Theme Chips */
.theme-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.theme-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.theme-chip:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.theme-chip.active {
  background-color: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.theme-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Menu Audio Player Box */
.menu-audio-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-audio-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-btn-large {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.audio-slider-menu {
  flex: 1;
  height: 4px;
  cursor: pointer;
}

/* Action Buttons */
.menu-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.menu-action-btn:hover {
  background-color: var(--bg-card);
  border-color: var(--border-medium);
}

.btn-highlight-action {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-highlight-action:hover {
  background-color: var(--primary-light);
}

.menu-select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 11px;
}

/* Shortcuts list */
.shortcuts-list {
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shortcut-item kbd {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: inherit;
  font-weight: 600;
  font-size: 9.5px;
}

/* ==================== Hideable Edge-Style Annotation Bar ==================== */
.annotation-bar {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-floating);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 120;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  animation: slide-annot-bar 0.18s ease;
  max-width: 96vw;
}

@keyframes slide-annot-bar {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.annotation-handle {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-right: 4px;
  border-right: 1px solid var(--border-light);
  white-space: nowrap;
}

.annot-tool-group {
  position: relative;
  display: flex;
  align-items: center;
}

.annot-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  padding: 3px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
  white-space: nowrap;
}

.annot-btn:hover {
  background-color: var(--bg-app);
}

.annot-btn.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.color-preview {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.2);
}

.color-picker-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 5px;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-top: 4px;
  z-index: 130;
}

.annot-tool-group:hover .color-picker-dropdown,
.annot-tool-group.show-colors .color-picker-dropdown {
  display: flex;
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  box-shadow: 0 0 0 2px var(--primary);
}

.annot-btn-danger:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.annot-close {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 4px;
}

/* ==================== Dual File Mode Bar ==================== */
.dual-file-bar {
  min-height: 30px;
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 12px;
  font-size: 11px;
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.dual-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dual-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pane1-badge {
  background-color: var(--primary-light);
  color: var(--primary);
}

.pane2-badge {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.dual-file-name {
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dual-file-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-medium);
}

/* ==================== Main Workspace ==================== */
#appWorkspace {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Welcome Screen (Scrollable on both Mobile & Desktop) */
.welcome-screen {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg-pane);
  padding: 24px 16px;
  user-select: text;
}

.welcome-scroll-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
}

.welcome-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 100%;
  max-width: 780px;
  padding: 26px 28px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.welcome-icon-wrap {
  margin-bottom: 8px;
}

.welcome-card h1 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.3px;
}

.welcome-byline {
  font-size: 11.5px;
  color: var(--primary);
  margin-bottom: 10px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.btn-large {
  padding: 9px 18px;
  font-size: 13px;
  border-radius: 7px;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  text-align: left;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-bottom: 14px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background-color: var(--bg-app);
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-light);
}

.feat-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.feature-item strong {
  font-size: 11.5px;
  color: var(--text-primary);
}

.feature-item span:last-child {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Extension & Win 10/11 Fix Quick Bar */
.welcome-ext-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ext-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ext-pill-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.ext-pill-primary:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.ext-pill-secondary {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.ext-pill-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.welcome-coffee-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  background-color: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 11px;
  color: #92400e;
}

body.theme-dark .welcome-coffee-box {
  background-color: #2e1065;
  border-color: #6b21a8;
  color: #f3e8ff;
}

.welcome-coffee-link {
  color: #b45309;
  font-weight: 700;
  text-decoration: none;
}

body.theme-dark .welcome-coffee-link {
  color: #fbbf24;
}

.welcome-coffee-link:hover {
  text-decoration: underline;
}

/* ==================== SEO & Student Guide Section ==================== */
.seo-info-section {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 760px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
}

.seo-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.04);
}

.seo-card h2 {
  font-size: 14px;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.seo-card p {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}

.seo-card ul, .seo-card ol {
  padding-left: 18px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seo-card a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.seo-card a:hover {
  text-decoration: underline;
}

.seo-card code {
  background: var(--bg-app);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
}

.seo-faq-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.04);
}

.seo-faq-box h2 {
  font-size: 14px;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item summary {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::after {
  content: "+";
  font-weight: 700;
  color: var(--primary);
  margin-left: 8px;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.seo-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seo-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.seo-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.seo-footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==================== Viewer Container & Panes ==================== */
.viewer-container {
  flex: 1;
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Default: Vertical Split (Up-Down / Top-and-Bottom) */
.viewer-container.layout-vertical {
  flex-direction: column;
}

.viewer-container.layout-vertical #pane1 {
  flex: 0 0 calc(50% - 1px);
  width: 100%;
  min-height: 60px;
}

.viewer-container.layout-vertical #pane2 {
  flex: 1 1 auto;
  width: 100%;
  min-height: 60px;
}

/* ULTRA-THIN 2PX RESIZER WITH TOUCH SUPPORT */
.viewer-container.layout-vertical #splitResizer {
  height: 2px;
  width: 100%;
  cursor: row-resize;
  background-color: var(--resizer-color);
  position: relative;
  z-index: 40;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-container.layout-vertical #splitResizer::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  right: 0;
  cursor: row-resize;
  z-index: 50;
}

.viewer-container.layout-vertical #splitResizer .resizer-grip {
  width: 34px;
  height: 4px;
  border-radius: 4px;
  background-color: var(--border-medium);
  pointer-events: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.viewer-container.layout-vertical #splitResizer:hover,
.viewer-container.layout-vertical #splitResizer.is-dragging {
  background-color: var(--resizer-active);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}

.viewer-container.layout-vertical #splitResizer:hover .resizer-grip,
.viewer-container.layout-vertical #splitResizer.is-dragging .resizer-grip {
  background-color: var(--resizer-active);
  transform: scaleX(1.2);
}

/* Horizontal Split */
.viewer-container.layout-horizontal {
  flex-direction: row;
}

.viewer-container.layout-horizontal #pane1 {
  flex: 0 0 calc(50% - 1px);
  height: 100%;
  min-width: 80px;
}

.viewer-container.layout-horizontal #pane2 {
  flex: 1 1 auto;
  height: 100%;
  min-width: 80px;
}

.viewer-container.layout-horizontal #splitResizer {
  width: 2px;
  height: 100%;
  cursor: col-resize;
  background-color: var(--resizer-color);
  position: relative;
  z-index: 40;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-container.layout-horizontal #splitResizer::before {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: 0;
  bottom: 0;
  cursor: col-resize;
  z-index: 50;
}

.viewer-container.layout-horizontal #splitResizer .resizer-grip {
  width: 4px;
  height: 34px;
  border-radius: 4px;
  background-color: var(--border-medium);
  pointer-events: none;
}

.viewer-container.layout-horizontal #splitResizer:hover,
.viewer-container.layout-horizontal #splitResizer.is-dragging {
  background-color: var(--resizer-active);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.6);
}

/* Single View */
.viewer-container.layout-single #pane1 {
  flex: 1 1 100%;
  width: 100%;
  height: 100%;
}

.viewer-container.layout-single #splitResizer,
.viewer-container.layout-single #pane2 {
  display: none !important;
}

/* ==================== Panes & Floating Micro Bar ==================== */
.viewer-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-pane);
  position: relative;
}

.pane-floating-bar {
  position: absolute;
  top: 8px;
  right: 14px;
  background-color: var(--bg-floating);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0.9;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pane-floating-bar:hover {
  opacity: 1;
}

.floating-tag {
  font-size: 9px;
  font-weight: 750;
  padding: 1px 5px;
  border-radius: 8px;
  text-transform: uppercase;
}

.floating-nav, .floating-zoom {
  display: flex;
  align-items: center;
  gap: 2px;
}

.f-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.f-btn:hover {
  background-color: var(--bg-app);
  border-color: var(--border-medium);
}

.f-page-info {
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
}

.f-page-info input {
  width: 26px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 10.5px;
  color: var(--text-primary);
  outline: none;
}

.f-select {
  background: transparent;
  border: 1px solid transparent;
  font-size: 10px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  padding: 1px;
}

.f-select:hover {
  background-color: var(--bg-app);
  border-color: var(--border-medium);
  border-radius: 3px;
}

/* ==================== Viewports ==================== */
.pane-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 38px 0 14px 0;
}

.pane-viewport::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.pane-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.pane-viewport::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.pane-viewport::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.pages-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 100%;
}

.page-container {
  position: relative;
  background-color: #ffffff;
  box-shadow: var(--pdf-page-shadow);
  border-radius: 2px;
  overflow: hidden;
  user-select: text;
}

.page-canvas {
  display: block;
  filter: var(--pdf-filter);
  transition: filter 0.2s ease;
}

/* Annotation Canvas Layer */
.annotation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.annotation-active .annotation-canvas {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

/* Text Layer */
.text-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  line-height: 1.0;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  z-index: 10;
}

.text-layer > span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  user-select: text;
  -webkit-user-select: text;
}

.text-layer ::selection {
  background: rgba(37, 99, 235, 0.35);
}

body.theme-dark .text-layer ::selection {
  background: rgba(56, 189, 248, 0.45);
}

.user-text-annotation {
  position: absolute;
  background: rgba(254, 240, 138, 0.92);
  color: #1e293b;
  border: 1px solid #eab308;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 500;
  min-width: 60px;
  min-height: 24px;
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  user-select: text;
  -webkit-user-select: text;
  z-index: 20;
}

/* ==================== IELTS Drawer ==================== */
.ielts-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: min(var(--drawer-width), 92vw);
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 155;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ielts-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-primary);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
}

.drawer-close-btn:hover {
  color: var(--text-primary);
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-app);
}

.drawer-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.drawer-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: var(--bg-card);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.tab-actions-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-app);
  padding: 3px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.answer-qnum {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 20px;
}

.answer-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  text-transform: uppercase;
  width: 100%;
}

.answer-input:focus {
  border-color: var(--primary);
}

.notes-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.scratchpad-area {
  width: 100%;
  height: 340px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 8px;
  font-family: var(--font-family);
  font-size: 12px;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  line-height: 1.45;
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.notes-status {
  font-size: 10px;
  color: var(--text-muted);
}

/* ==================== Drag & Drop Overlay ==================== */
.drop-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(37, 99, 235, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.drop-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.drop-modal {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 24px 36px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
}

.drop-modal h3 {
  font-size: 15px;
  color: #0f172a;
  margin: 8px 0 4px;
}

.drop-modal p {
  font-size: 11px;
  color: #64748b;
}

/* ==================== Toast ==================== */
.toast-container {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 400;
  pointer-events: none;
}

.toast {
  background-color: #0f172a;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  animation: toast-fade 0.15s ease;
  text-align: center;
}

@keyframes toast-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== File Permission & Win 10/11 Fix Modals ==================== */
.file-perm-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}

.file-perm-card {
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  border: 1px solid var(--border-light);
  position: relative;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.file-perm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.file-perm-icon {
  font-size: 24px;
}

.file-perm-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.file-perm-close {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.file-perm-close:hover {
  color: var(--text-primary);
}

.file-perm-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.file-perm-desc code {
  background: var(--bg-pane);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  word-break: break-all;
}

.file-perm-guide {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.perm-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11.5px;
}

.perm-step-num {
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}

.perm-step-text {
  flex: 1;
  color: var(--text-primary);
  line-height: 1.45;
}

.perm-step-text a {
  color: var(--primary);
}

.perm-copy-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.perm-copy-box input {
  flex: 1;
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-tiny {
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

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

.perm-highlight {
  color: #d97706;
  font-weight: 600;
}

.file-perm-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0 12px 0;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.file-perm-divider::before, .file-perm-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}

.file-perm-divider span {
  padding: 0 10px;
}

/* ==========================================================================
   RESPONSIVE DESIGN FOR TABLETS & MOBILE PHONES (Phone & Computer Look Fix)
   ========================================================================== */

@media (max-width: 900px) {
  .main-header {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 6px;
  }

  .header-left {
    order: 1;
  }

  .header-right {
    order: 2;
    margin-left: auto;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--border-light);
    padding-top: 5px;
    overflow-x: auto;
  }

  .file-pill {
    max-width: 110px;
  }
}

@media (max-width: 600px) {
  .creator-badge {
    display: none;
  }

  #btnFullscreen {
    display: none;
  }

  .file-pill {
    display: none !important;
  }

  .brand-group {
    padding-right: 5px;
    gap: 4px;
  }

  .brand-name {
    font-size: 12.5px;
  }

  .header-right {
    gap: 4px;
  }

  .header-right .btn-label-text {
    display: none;
  }

  .btn, .tool-btn {
    padding: 5px 8px;
  }

  .header-center {
    gap: 4px;
  }

  .layout-btn, .mode-btn {
    padding: 4px 6px;
    font-size: 10.5px;
  }

  .welcome-screen {
    padding: 12px 10px;
  }

  .welcome-card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .welcome-card h1 {
    font-size: 18px;
  }

  .welcome-subtitle {
    font-size: 11.5px;
    margin-bottom: 14px;
  }

  .welcome-actions {
    flex-direction: column;
    gap: 8px;
  }

  .welcome-actions .btn-large {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  .welcome-features {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .welcome-ext-bar {
    flex-direction: column;
    width: 100%;
  }

  .ext-pill-btn {
    width: 100%;
    padding: 8px 10px;
  }

  .seo-card, .seo-faq-box {
    padding: 14px;
  }

  /* Floating Pane Bar on Mobile */
  .pane-floating-bar {
    top: 5px;
    right: 6px;
    padding: 2px 6px;
    gap: 3px;
    max-width: calc(100% - 12px);
    flex-wrap: wrap;
    justify-content: center;
  }

  .viewer-container.layout-horizontal .pane-floating-bar {
    left: 4px;
    right: 4px;
    border-radius: 12px;
    max-width: calc(100% - 8px);
  }

  .viewer-container.layout-horizontal .pane-viewport {
    padding-top: 62px;
  }

  .floating-tag {
    font-size: 8.5px;
    padding: 1px 4px;
  }

  .f-btn {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .header-center {
    scrollbar-width: none;
  }

  .header-center::-webkit-scrollbar {
    display: none;
  }

  /* Annotation Bar on Mobile sits comfortably at bottom */
  .annotation-bar {
    top: auto;
    bottom: 12px;
    padding: 5px 8px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .annotation-handle {
    display: none;
  }

  .color-picker-dropdown {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
  }

  .dual-file-bar {
    justify-content: space-between;
    padding: 4px 8px;
  }

  .dual-file-divider {
    display: none;
  }

  .dual-file-item {
    width: 100%;
    justify-content: space-between;
  }

  /* Larger touch area for split resizer on phones */
  .viewer-container.layout-vertical #splitResizer::before {
    top: -14px;
    bottom: -14px;
  }

  .viewer-container.layout-vertical #splitResizer .resizer-grip {
    width: 44px;
    height: 5px;
  }
}

@media (max-width: 430px) {
  .main-header {
    padding: 5px 8px;
  }

  .brand-name {
    display: none;
  }

  .brand-group {
    border-right: none;
    padding-right: 2px;
  }

  .timer-display {
    font-size: 10.5px;
    min-width: 30px;
  }

  .layout-btn, .mode-btn {
    padding: 4px 5px;
    font-size: 9.5px;
    gap: 2px;
  }

  .layout-btn svg {
    width: 11px;
    height: 11px;
  }

  .annot-btn {
    padding: 4px 6px;
    font-size: 10px;
  }
}
