* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: #f2f4f7;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  color: #1f2937;
  padding: 48px 24px;
}

.page {
  max-width: 640px;
  width: 100%;
}

.tool-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tool-nav-link {
  padding: 8px 18px;
  border-radius: 20px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tool-nav-link:hover {
  background: #dbeafe;
}

.tool-nav-link.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #eff6ff;
  border-radius: 10px;
  padding: 10px 16px;
  margin: -8px 0 24px;
  font-size: 15px;
  color: #1e3a8a;
  text-align: left;
}

.auth-bar[hidden] {
  display: none;
}

.auth-bar.subscribed {
  background: #ecfdf5;
  color: #065f46;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  flex-shrink: 0;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 48px;
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.info-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 40px 48px;
  margin-top: 24px;
  text-align: left;
}

.info-card h2 {
  font-size: 24px;
  color: #111827;
  margin: 0 0 16px;
}

.info-card h2:not(:first-child) {
  margin-top: 32px;
}

.steps {
  font-size: 18px;
  line-height: 1.6;
  color: #374151;
  padding-left: 22px;
  margin: 0;
}

.faq-item {
  margin-bottom: 20px;
}

.faq-item h3 {
  font-size: 18px;
  color: #1e3a8a;
  margin: 0 0 6px;
}

.faq-item p {
  font-size: 16px;
  line-height: 1.6;
  color: #4b5563;
  margin: 0;
}

@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding: 12px;
    font-size: 17px;
  }

  .card {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .tool-nav {
    gap: 6px;
  }

  .tool-nav-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .auth-bar {
    font-size: 13px;
    padding: 8px 12px;
    margin: -4px 0 18px;
  }

  .link-btn {
    font-size: 13px;
  }

  .info-card {
    padding: 22px 20px;
    margin-top: 16px;
  }

  .info-card h2 {
    font-size: 20px;
  }

  .steps {
    font-size: 16px;
  }

  .faq-item h3 {
    font-size: 16px;
  }

  .faq-item p {
    font-size: 15px;
  }
}

h1 {
  font-size: 36px;
  margin: 0 0 16px;
  color: #111827;
}

.subtitle {
  font-size: 20px;
  line-height: 1.5;
  color: #4b5563;
  margin: 0 0 32px;
}

.dropzone {
  border: 3px dashed #93c5fd;
  border-radius: 12px;
  padding: 40px 24px;
  background: #eff6ff;
  transition: background 0.2s, border-color 0.2s;
}

.dropzone.dragover {
  background: #dbeafe;
  border-color: #2563eb;
}

.dropzone-text {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #1e3a8a;
}

.dropzone-or {
  margin: 0 0 16px;
  color: #6b7280;
}

@media (max-width: 480px) {
  h1 {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .dropzone {
    padding: 22px 14px;
  }

  .dropzone-text {
    font-size: 18px;
  }

  .dropzone-or {
    margin-bottom: 10px;
    font-size: 14px;
  }
}

.btn {
  font-size: 20px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 16px 28px;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-success {
  background: #16a34a;
  color: #ffffff;
}

.btn-secondary {
  background: #e5e7eb;
  color: #1f2937;
  margin-top: 16px;
}

a.btn {
  text-decoration: none;
  display: inline-block;
}

.btn-large {
  font-size: 24px;
  padding: 20px 36px;
  width: 100%;
}

.btn + .btn {
  margin-top: 16px;
}

.text-input {
  display: block;
  width: 100%;
  font-size: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  box-sizing: border-box;
}

.text-input:focus {
  outline: none;
  border-color: #2563eb;
}

.price-info {
  font-size: 18px;
  color: #1e3a8a;
  font-weight: 600;
  margin: -20px 0 32px;
}

.selected-file {
  margin-top: 28px;
}

.selected-file p {
  font-size: 20px;
  word-break: break-all;
  margin-bottom: 16px;
}

.format-choice {
  margin-bottom: 20px;
}

.format-choice-label {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 8px;
}

.format-btn {
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 10px;
  padding: 12px 20px;
  margin: 0 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.format-btn:hover {
  border-color: #93c5fd;
}

.format-btn.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
}

.pay-note {
  font-size: 16px;
  color: #6b7280;
  margin: 12px 0 0;
}

@media (max-width: 480px) {
  .btn {
    padding: 12px 20px;
    font-size: 17px;
  }

  .btn-large {
    font-size: 19px;
    padding: 15px 24px;
  }

  .price-info {
    font-size: 15px;
    margin: -8px 0 18px;
  }

  .selected-file {
    margin-top: 18px;
  }

  .selected-file p {
    font-size: 17px;
    margin-bottom: 10px;
  }

  .format-choice-label {
    font-size: 14px;
  }

  .format-btn {
    font-size: 14px;
    padding: 10px 14px;
    margin: 4px;
  }

  .pay-note {
    font-size: 14px;
  }

  .text-input {
    font-size: 16px;
    padding: 11px 14px;
  }
}

.status {
  margin-top: 24px;
  font-size: 20px;
  font-weight: 600;
}

.status.error {
  color: #dc2626;
}

.status.loading {
  color: #1e3a8a;
}

.result-box {
  margin-top: 28px;
}

.result-box p {
  font-size: 22px;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin: 20px 0;
  text-align: left;
}

.page-thumb {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px;
  background: #f9fafb;
  cursor: grab;
  text-align: center;
  user-select: none;
}

.page-thumb.dragging {
  opacity: 0.4;
}

.page-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.page-thumb-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.page-thumb-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 20px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.email-backup {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.email-backup-label {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 10px;
}

.email-backup-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.email-backup-row .text-input {
  flex: 1;
  min-width: 200px;
}

.email-backup-status {
  margin-top: 10px;
  font-size: 14px;
}

.email-backup-status.error {
  color: #dc2626;
}

.email-backup-status.success {
  color: #15803d;
}

.site-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: #9ca3af;
}

.site-footer a {
  color: #9ca3af;
}
