body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 110, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 110, 248, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 56px;
}

header h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

header h1 span {
  color: var(--accent);
}

header p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 300;
  max-width: 440px;
  margin-inline: auto;
  line-height: 1.7;
}

/* Tab Nav */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 32px;
}

.tab-btn {
  flex: 1;
  font-family: "Syne", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--muted);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab-btn:hover {
  color: var(--text);
  background: var(--surface2);
}
.tab-btn.active {
  background: var(--accent);
  color: #0a0a0f;
}
.tab-btn .tab-icon {
  font-size: 16px;
}

/* Panels */
.panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.panel.active {
  display: block;
}

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

/* Card */
.card {
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 20px;
}
.card h3 {
  font-family: "Syne", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Upload Area */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(232, 255, 71, 0.03);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone .upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}
.upload-zone p {
  color: var(--muted);
  font-size: 14px;
}
.upload-zone strong {
  color: var(--text);
}

/* File list */
.file-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  animation: slideIn 0.2s ease;
}
.file-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}
.file-item.drag-target {
  border-color: var(--accent2);
  background: rgba(124, 110, 248, 0.08);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.file-item .file-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item .file-size {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.file-item .drag-handle {
  color: var(--muted);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
}
.file-item .drag-handle:active {
  cursor: grabbing;
}
.file-item .remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.file-item .remove-btn:hover {
  color: var(--accent3);
}
.file-item .page-badge {
  font-size: 11px;
  color: var(--accent2);
  background: rgba(124, 110, 248, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

/* Order hint */
.order-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* Settings */
.setting-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.setting-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.setting-group select,
.setting-group input[type="text"] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}
.setting-group select:focus,
.setting-group input:focus {
  border-color: var(--accent);
}

.range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.range-label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

/* Split specific */
.split-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.split-mode-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-btn {
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn.active {
  background: rgba(232, 255, 71, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.page-ranges-input {
  display: none;
}
.page-ranges-input.visible {
  display: block;
}
.page-ranges-input input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.page-ranges-input input:focus {
  border-color: var(--accent);
}
.page-ranges-input small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.every-n-input {
  display: none;
}
.every-n-input.visible {
  display: flex;
  gap: 12px;
  align-items: center;
}
.every-n-input input {
  width: 80px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  text-align: center;
}
.every-n-input span {
  color: var(--muted);
  font-size: 14px;
}

/* Action Button */
.action-btn {
  width: 100%;
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.action-btn:hover:not(:disabled) {
  background: #f5ff80;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(232, 255, 71, 0.2);
}
.action-btn:active:not(:disabled) {
  transform: translateY(0);
}
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Progress */
.progress-wrap {
  margin-top: 20px;
  display: none;
}
.progress-wrap.visible {
  display: block;
}
.progress-bar {
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Error */
.error-box {
  display: none;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--accent3);
  margin-top: 16px;
  display: none;
  align-items: flex-start;
  gap: 10px;
}
.error-box.visible {
  display: flex;
}

/* Result */
.result-card {
  display: none;
  background: rgba(77, 255, 180, 0.05);
  border: 1px solid rgba(77, 255, 180, 0.2);
  border-radius: 16px;
  padding: 28px;
  margin-top: 20px;
}
.result-card.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}
.result-card h4 {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 100px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.stat .val {
  font-family: "Syne", sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.stat .lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.download-btn {
  width: 100%;
  font-family: "Syne", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--success);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.download-btn:hover {
  background: #7dffca;
}
.download-btn + .download-btn {
  margin-top: 8px;
}

.split-downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.split-download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}
.split-download-item span {
  flex: 1;
}
.split-download-item .dl-btn {
  background: var(--success);
  color: #0a0a0f;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: "Syne", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.split-download-item .dl-btn:hover {
  background: #7dffca;
}

.merge-info-section {
  max-width: 1200px;
  margin: 56px auto 0;
  padding: 0 20px 64px;
  font-family: Georgia, "Times New Roman", serif;
  color: #1a1a2e;
}

.merge-info-section h2 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #0f0f23;
  letter-spacing: -0.3px;
}

.merge-info-section .section-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.merge-divider {
  border: none;
  border-top: 2px solid #e8e8f0;
  margin: 48px 0;
}

/* Steps */
.how-to-steps {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
  margin: 0;
}

.how-to-steps li {
  counter-increment: step-counter;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 80px;
  padding: 20px 22px;
  background: #ededed;
  border-radius: 10px;
  border-left: 4px solid #4f46e5;
}

.how-to-steps li::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  background: #4f46e5;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.how-to-steps li .step-content h4 {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
}

.how-to-steps li .step-content p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #444;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Tips box */
.tips-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 18px 22px;
  margin-top: 8px;
}

.tips-box h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  color: #92400e;
}

.tips-box ul {
  margin: 0;
  padding-left: 18px;
}

.tips-box ul li {
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #78350f;
  line-height: 1.6;
  margin-bottom: 5px;
}

/* FAQ */
.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-item {
  border-bottom: 1px solid #e8e8f0;
}

.faq-item:first-child {
  border-top: 1px solid #e8e8f0;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 18px 4px;
  font-size: 1rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
}

.faq-question:hover {
  color: #4f46e5;
}

.faq-chevron {
  font-style: normal;
  font-size: 1.1rem;
  transition: transform 0.25s ease;
  flex-shrink: 0;
  color: #4f46e5;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 4px 18px;
  font-size: 0.93rem;
  line-height: 1.72;
  color: #444;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Use-cases grid */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.use-case-card {
  background: #f0f0ff;
  border-radius: 10px;
  padding: 18px 16px;
}

.use-case-card .uc-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.use-case-card h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
}

.use-case-card p {
  margin: 0;
  font-size: 0.85rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #555;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .tab-btn {
    font-size: 11px;
    padding: 10px 8px;
    gap: 6px;
  }
  .tab-icon {
    display: none;
  }
}
