:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: #1a1a1a;
  background-color: #ffffff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: #ffffff;
}

.app-header {
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.app-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header-copy {
  flex: 1;
  min-width: 0;
}

.app-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app-header .subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.375rem;
  line-height: 1.4;
}

.app-header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}

.header-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.header-cta {
  text-decoration: none;
  text-align: center;
}

.license-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.license-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.license-badge-free {
  background: #f3f4f6;
  color: #6b7280;
}

.license-badge-pro {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.btn-ghost {
  background: transparent;
  color: #396cd8;
  border: 1px solid rgba(57, 108, 216, 0.3);
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(57, 108, 216, 0.08);
  border-color: rgba(57, 108, 216, 0.5);
  text-decoration: none;
}

.btn-ghost:focus {
  text-decoration: none;
  outline: none;
  box-shadow: 0 0 0 3px rgba(57, 108, 216, 0.1);
}

.main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
  overflow: hidden;
  background: #ffffff;
  min-height: 0; /* Critical for flex scrolling chain */
  max-height: 100%; /* Ensure it doesn't exceed parent */
}

/* App Layout with Sidebar */
.app-layout {
  display: flex;
  flex: 1 1 0%; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
  overflow: hidden;
  background: #ffffff;
  min-height: 0; /* Critical for flex scrolling chain */
  max-height: 100%; /* Ensure it doesn't exceed parent */
}

/* Left Sidebar Navigation */
.feature-sidebar {
  width: 80px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.feature-nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.5rem;
  gap: 0.5rem;
}

.feature-nav-item {
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #1a1a1a;
  position: relative;
}

.feature-nav-item:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-nav-item.active {
  background: #e8f0fe;
  border-color: #396cd8;
  color: #396cd8;
}

.feature-nav-item.active:hover {
  background: #dbeafe;
  border-color: #2d5bb8;
}

.feature-nav-item.premium::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.feature-nav-item.coming-soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.feature-nav-item.coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.feature-nav-icon {
  line-height: 1;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.feature-nav-icon svg {
  width: 24px;
  height: 24px;
}

.feature-nav-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content Area */
.app-main-content {
  flex: 1 1 0%; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0; /* Allow flex children to shrink below content size */
  max-height: 100%; /* Ensure it doesn't exceed parent */
}

.landing-main {
  flex: 1;
  overflow-y: auto;
  padding: 4rem 2rem;
  background: #ffffff;
}

/* Hero Section */
.landing-hero {
  max-width: 800px;
  margin: 0 auto 6rem;
  text-align: center;
}

.landing-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.landing-hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.landing-hero-subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  margin: 0;
  font-weight: 400;
}

.landing-hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Features Visual Grid */
.landing-features {
  max-width: 900px;
  margin: 0 auto 6rem;
  text-align: center;
}

.features-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-visual-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  transition: all 0.2s ease;
}

.feature-visual-card:hover {
  background: #ffffff;
  border-color: #396cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.1);
}

.feature-icon {
  margin-bottom: 0.75rem;
  line-height: 1;
  color: #396cd8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
}

.feature-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}

.features-note {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 1.5rem;
}

/* Why Section */
.landing-why {
  max-width: 900px;
  margin: 0 auto 6rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.why-item {
  text-align: center;
  padding: 2rem 1rem;
}

.why-icon {
  margin-bottom: 1rem;
  line-height: 1;
  color: #396cd8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.why-icon svg {
  width: 48px;
  height: 48px;
}

.why-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.why-text {
  font-size: 0.9375rem;
  color: #6b7280;
}

/* Pricing Section */
.landing-pricing {
  max-width: 800px;
  margin: 0 auto 6rem;
  text-align: center;
}

.pricing-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.pricing-simple {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.pricing-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pricing-item-highlight {
  background: #ffffff;
  border-color: #396cd8;
  border-width: 2px;
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.15);
}

.pricing-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.pricing-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #396cd8;
  margin: 0.25rem 0;
}

.pricing-desc {
  font-size: 0.875rem;
  color: #6b7280;
  flex: 1;
}

/* FAQ Section */
.landing-faq {
  max-width: 700px;
  margin: 0 auto 4rem;
  text-align: center;
}

.faq-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

.faq-simple {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item-simple {
  font-size: 1rem;
  color: #4b5563;
  line-height: 1.6;
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.faq-item-simple strong {
  color: #111827;
  font-weight: 600;
  margin-right: 0.5rem;
}

.landing-section {
  max-width: 1120px;
  margin: 0 auto 2.5rem;
}

.landing-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

.landing-paragraph {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.7;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.feature-card h4 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #111827;
}

.feature-card p {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
}

/* Feature Categories (Landing Page) */
.feature-category {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.feature-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-category-title small {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  margin-left: 0.25rem;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  transition: all 0.2s ease;
}

.feature-tag:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.feature-tag.feature-premium {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.feature-tag.feature-premium:hover {
  background: #fde68a;
  border-color: #fcd34d;
}

.feature-tag small {
  font-size: 0.6875rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Simple feature list (for SEO) */
.features-simple-list {
  max-width: 800px;
  margin: 0 auto;
}

.features-simple-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.features-simple-list li {
  padding: 0.75rem 0;
  color: #4b5563;
  font-size: 0.9375rem;
  line-height: 1.6;
  border-bottom: 1px solid #f3f4f6;
}

.features-simple-list li:last-child {
  border-bottom: none;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.pricing-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 1.25rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.pricing-card-highlight {
  border-color: #4f46e5;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.18);
}

.pricing-tier {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5563;
}

.pricing-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
}

.pricing-tagline {
  font-size: 0.85rem;
  color: #6b7280;
}

.pricing-features {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.pricing-features li + li {
  margin-top: 0.25rem;
}

.landing-faq .faq-item + .faq-item {
  margin-top: 0.75rem;
}

.faq-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.faq-item p {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
}

/* Main content column */
.left-panel {
  flex: 1 1 0%; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0% - ensures proper flex behavior */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 2.5rem 3rem;
  background: #ffffff;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-height: 0; /* Critical for flex scrolling - allows container to shrink */
  max-height: 100%; /* Ensure it doesn't exceed parent */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  
  /* Custom scrollbar styling */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #cbd5e1 #f1f5f9; /* Firefox: thumb and track */
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
.left-panel::-webkit-scrollbar {
  width: 8px;
}

.left-panel::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
}

.left-panel::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.upload-section {
  margin-bottom: 0;
}

.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f9fafb;
  transition: all 0.2s ease;
  cursor: pointer;
  max-width: 100%;
  margin: 0 auto;
}

.upload-zone:hover {
  border-color: #396cd8;
  background: #f3f4f6;
}

.upload-zone.drag-over {
  border-color: #396cd8;
  background: #eef2ff;
  transform: scale(1.005);
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.1);
}

.upload-icon {
  color: #6b7280;
  margin-bottom: 1.25rem;
  opacity: 0.8;
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #111827;
}

.upload-subtext {
  font-size: 0.9375rem;
  color: #6b7280;
  margin: 0.75rem 0;
}

/* Feature List Section */
.feature-list-section {
  margin: 0 0 2rem 0;
  padding: 0;
  background: transparent;
  border: none;
}

.feature-list-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #111827;
  letter-spacing: -0.01em;
}

.feature-list-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 1rem 0;
  width: 100%;
}

.feature-list-content {
  display: block;
  background: transparent;
}

.feature-list-group {
  margin-bottom: 0.75rem;
}

.feature-list-group:last-child {
  margin-bottom: 0;
}

.feature-list-description {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 0;
  max-width: 700px;
}

.feature-list-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.feature-list-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-list-item {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #374151;
  font-weight: 500;
}

.feature-list-item.feature-list-coming-soon {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
  opacity: 0.8;
}

.feature-list-item.feature-list-premium {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.feature-list-item.feature-list-empty {
  color: #9ca3af;
  font-style: italic;
}

.pdfs-section,
.preview-section {
  margin-bottom: 0;
}

.pdfs-section h2,
.preview-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: #111827;
  letter-spacing: -0.01em;
}

.pdfs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pdf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  cursor: move;
  transition: all 0.2s ease;
  flex: 1 1 320px;
  max-width: 480px;
}

.pdf-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pdf-item.dragging {
  opacity: 0.8;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: none;
}

/* Drop placeholder for PDF items */
.drop-placeholder.pdf-placeholder {
  border: 3px dashed #396cd8;
  border-radius: 6px;
  background: rgba(57, 108, 216, 0.08);
  margin: 0 0 0.75rem 0;
  flex-shrink: 0;
  animation: placeholderPulse 1s ease-in-out infinite;
  box-sizing: border-box;
  min-height: 60px;
}

.pdf-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.pdf-label {
  font-weight: 600;
  color: #396cd8;
  font-size: 1rem;
  min-width: 2rem;
  letter-spacing: 0.02em;
}

.pdf-name {
  font-size: 0.9375rem;
  color: #4b5563;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.pdf-pages {
  font-size: 0.8125rem;
  color: #9ca3af;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.25rem;
  min-height: 160px;
}

.preview-item {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  cursor: grab;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  will-change: transform;
}

.preview-item:hover:not(.dragging) {
  border-color: #396cd8;
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.15);
  transform: translateY(-2px);
}

.preview-item.dragging {
  opacity: 0.8;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: none; /* Disable transition during drag for smooth movement */
}

/* Drop placeholder for preview items */
.drop-placeholder {
  border: 3px dashed #396cd8;
  border-radius: 6px;
  background: rgba(57, 108, 216, 0.08);
  margin: 0;
  flex-shrink: 0;
  animation: placeholderPulse 1s ease-in-out infinite;
  box-sizing: border-box;
  grid-column: span 1;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes placeholderPulse {
  0%, 100% {
    opacity: 0.6;
  border-color: #396cd8;
  }
  50% {
    opacity: 1;
    border-color: #2d5bb8;
  }
}

.preview-item.selected {
  border-color: #396cd8;
  background: #f0f4ff;
}

.preview-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #fafafa;
  display: block;
}

.preview-placeholder {
  width: 100%;
  height: 150px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.8rem;
}

.preview-placeholder-code {
  font-weight: 600;
  color: #666;
  margin-bottom: 0.25rem;
}

.preview-placeholder-text {
  font-size: 0.75rem;
}

.empty-state {
  padding: 2rem 1.5rem;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 0.9375rem;
  text-align: center;
  background: #f9fafb;
  margin-bottom: 0;
}

.preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  text-align: center;
}

/* Merge section (selection + notation) */
.merge-section {
  margin-bottom: 0;
}

.mode-description {
  font-size: 0.9375rem;
  color: #6b7280;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.text-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.9375rem;
  resize: vertical;
  margin-bottom: 0;
  background: #ffffff;
  color: #111827;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  outline: none;
  border-color: #396cd8;
  box-shadow: 0 0 0 3px rgba(57, 108, 216, 0.1);
}

/* Buttons */
.btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

a.btn,
button.btn {
  text-decoration: none;
}

a.btn:hover,
a.btn:focus,
a.btn:visited {
  text-decoration: none;
}

.btn-primary {
  background: #396cd8;
  color: white;
}

.btn-primary:hover {
  background: #2d5bc7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.25);
}

.btn-primary:active {
  background: #2563eb;
  transform: translateY(0);
}

.merge-button-wrapper {
  position: relative;
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 0;
  padding-bottom: 0;
}

.btn-merge {
  width: 100%;
  padding: 1.125rem 1.5rem;
  background: #396cd8;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-merge:hover:not(:disabled) {
  background: #2d5bc7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(57, 108, 216, 0.3);
}

.btn-merge:active:not(:disabled) {
  background: #2563eb;
  transform: translateY(0);
}

.btn-merge:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.merge-btn-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none; /* Prevent text from blocking clicks */
  white-space: nowrap;
}

.merge-btn-dropdown-icon {
  position: absolute;
  right: 0;
  padding: 0 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 100%;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
  color: currentColor;
}

.merge-btn-dropdown-icon svg {
  width: 12px;
  height: 12px;
}

.btn-merge:hover:not(:disabled) .merge-btn-dropdown-icon {
  opacity: 0.9;
}

.btn-merge:disabled .merge-btn-dropdown-icon {
  border-left-color: rgba(153, 153, 153, 0.3);
  cursor: not-allowed;
}

.merge-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  display: none;
  box-sizing: border-box;
}

.merge-dropdown-menu.hidden {
  display: none;
}

.merge-dropdown-menu:not(.hidden) {
  display: block;
}

.merge-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: white;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.merge-dropdown-item-text {
  flex: 1;
  text-align: center;
}

.merge-dropdown-item-spacer {
  width: 16px;
  flex-shrink: 0;
}

.merge-dropdown-item:hover {
  background: #f5f5f5;
}

.merge-dropdown-item:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.merge-dropdown-item:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  margin-bottom: 0;
  padding-bottom: 0.75rem;
}

/* Responsive adjustments for merge button */
@media (max-width: 768px) {
  .merge-button-wrapper {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  .btn-merge {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }
  
  .merge-dropdown-item {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }
  
  .merge-dropdown-item:last-child {
    padding-bottom: 1.25rem;
  }
}

@media (max-width: 480px) {
  .merge-button-wrapper {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }
  
  .btn-merge {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .merge-dropdown-item {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e5e5;
  border-top-color: #396cd8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: #666;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
}

/* License modal */
.license-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.license-modal.hidden {
  display: none;
}

.license-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.license-modal-dialog {
  position: relative;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem 1.75rem 1.25rem;
  z-index: 1501;
}

.license-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.license-modal-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
  letter-spacing: -0.01em;
}

.license-modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: #f3f4f6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #374151;
}

.license-modal-close:hover {
  background: #e5e7eb;
}

.license-modal-body {
  font-size: 0.875rem;
  color: #4b5563;
}

.license-modal-copy {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.license-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.license-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.875rem;
  font-family: inherit;
}

.license-input:focus {
  outline: none;
  border-color: #396cd8;
  box-shadow: 0 0 0 3px rgba(57, 108, 216, 0.15);
}

.license-status-message {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.license-status-message.success {
  color: #065f46;
}

.license-status-message.error {
  color: #b91c1c;
}

.license-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  max-width: 400px;
  font-size: 0.875rem;
  font-weight: 500;
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: #10b981;
  color: white;
}

.toast-error {
  background: #ef4444;
  color: white;
}

.toast-info {
  background: #3b82f6;
  color: white;
}

.toast-warning {
  background: #f59e0b;
  color: white;
}

/* PDF remove button */
.pdf-item {
  position: relative;
}

.pdf-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.pdf-item:hover .pdf-remove-btn {
  opacity: 1;
}

.pdf-remove-btn:hover {
  background: #dc2626;
}

/* Preview remove button */
.preview-item {
  position: relative;
}

.preview-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.preview-item:hover .preview-remove-btn {
  opacity: 1;
}

.preview-remove-btn:hover {
  background: #dc2626;
}

/* Preview loading spinner */
.preview-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e5e5;
  border-top-color: #396cd8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 8px;
}

/* Text selection validation */
.text-selection-validation {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  padding: 0.5rem;
  border-radius: 4px;
}

.text-selection-validation > div {
  margin: 0.25rem 0;
}

.text-selection-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.text-selection-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.text-selection-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Full Preview Modal */
.full-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-preview-modal.hidden {
  display: none;
}

.full-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.full-preview-container {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  display: flex;
  flex-direction: column;
  z-index: 2001;
  overflow: hidden;
}

.full-preview-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.full-preview-close:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.full-preview-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  min-width: 800px;
  min-height: 600px;
  max-width: 95vw;
  max-height: 85vh;
  overflow: auto;
  background: #fafafa;
}

#full-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: white;
}

.full-preview-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.125rem;
  color: #666;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.full-preview-loading::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #e5e5e5;
  border-top-color: #396cd8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.full-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 2rem;
  font-weight: 600;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.full-preview-nav:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.full-preview-nav.prev {
  left: 1.5rem;
}

.full-preview-nav.next {
  right: 1.5rem;
}

.full-preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-top: 1px solid #e5e5e5;
  background: #ffffff;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.full-preview-rotate-controls,
.full-preview-download-controls {
  display: flex;
  gap: 0.75rem;
}

.full-preview-quality-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}

.quality-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
}

.quality-slider-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.quality-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e5e5;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #396cd8;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.quality-slider::-webkit-slider-thumb:hover {
  background: #2d5bb8;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.quality-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #396cd8;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.quality-slider::-moz-range-thumb:hover {
  background: #2d5bb8;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.quality-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #396cd8;
  min-width: 200px;
  text-align: right;
  line-height: 1.4;
}

.quality-value > div:first-child {
  font-weight: 600;
  color: #396cd8;
}

.quality-value > div:last-child {
  font-size: 0.6875rem;
  color: #666;
  font-weight: 400;
}

.rotate-btn,
.download-btn {
  padding: 0.625rem 1.25rem;
  border: 2px solid #e5e5e5;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.download-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.rotate-btn:hover,
.download-btn:hover {
  background: #f5f5f5;
  border-color: #396cd8;
  color: #396cd8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(57, 108, 216, 0.15);
}

.rotate-btn:active,
.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(57, 108, 216, 0.1);
}

.full-preview-page-info {
  font-size: 0.9375rem;
  color: #666;
  font-weight: 600;
  margin-left: auto;
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .full-preview-container {
    max-width: 98vw;
    max-height: 98vh;
    border-radius: 8px;
  }
  
  .full-preview-content {
    min-width: auto;
    min-height: auto;
    padding: 1.5rem;
    max-height: 80vh;
  }
  
  .full-preview-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
  }

  .full-preview-nav {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.5rem;
  }
  
  .full-preview-nav.prev {
    left: 0.75rem;
  }

  .full-preview-nav.next {
    right: 0.75rem;
  }
  
  .full-preview-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 1rem;
  }
  
  .full-preview-rotate-controls,
  .full-preview-download-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .full-preview-quality-control {
    min-width: auto;
    width: 100%;
    justify-content: space-between;
  }
  
  .quality-slider-container {
    flex: 1;
    max-width: 300px;
  }
  
  .quality-value {
    min-width: 80px;
    text-align: left;
  }
  
  .rotate-btn,
  .download-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  .full-preview-page-info {
    margin-left: 0;
    text-align: center;
    padding: 0.5rem;
  }
}

/* Responsive header adjustments */
@media (max-width: 768px) {
  .app-header {
    padding: 1rem 1.5rem;
  }

  .app-header-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .app-header h1 {
    font-size: 1.25rem;
  }

  .app-header .subtitle {
    font-size: 0.8125rem;
  }

  .app-header-actions {
    align-items: flex-end;
    justify-content: flex-end;
    flex-direction: row;
    width: 100%;
    gap: 0.75rem;
  }

  .license-status {
    width: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .header-cta-buttons {
    justify-content: flex-end;
    width: auto;
  }

  .landing-main {
    padding: 1.5rem 1.25rem 2.5rem;
  }

  /* Landing page mobile */
  .landing-main {
    padding: 2rem 1.25rem;
  }

  .landing-hero {
    margin-bottom: 4rem;
  }

  .landing-hero-title {
    font-size: 2.25rem;
  }

  .landing-hero-subtitle {
    font-size: 1.125rem;
  }

  .landing-hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .btn-large {
    width: 100%;
  }

  .features-visual-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pricing-simple {
    grid-template-columns: 1fr;
  }

  .pricing-title,
  .faq-title {
    font-size: 2rem;
  }

  /* Sidebar navigation on mobile */
  .feature-sidebar {
    width: 60px;
  }

  .feature-nav-item {
    width: 52px;
    height: 52px;
  }

  .feature-nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .feature-nav-label {
    font-size: 0.5625rem;
  }
}
