.tool-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: center;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  font-family: "Montserrat", sans-serif;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
  border-color: var(--brand);
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.converter-card {
  background: var(--surface);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  text-align: left;
}

.upload-box {
  display: flex;
  min-height: 190px;
  border: 2px dashed #9cbafc;
  border-radius: 22px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  background: #f9fbff;
  transition: 0.25s;
}

.upload-box.dragover {
  border-color: var(--brand);
  background: #eef4ff;
}

.upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
  font-weight: 700;
}

.upload-box input {
  display: none;
}

.settings {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.settings.single-col {
  grid-template-columns: 1fr;
}

.two-col-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.limit-note {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: var(--brand-soft);
  border: 1px solid #d4e2ff;
  border-radius: 10px;
  padding: 8px 10px;
}

.settings label {
  font-weight: 600;
  color: #334155;
}

.settings select {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 15px;
}

.merge-mode-group {
  display: grid;
  gap: 8px;
  background: #f8fbff;
  border: 1px solid #dbe7ff;
  border-radius: 14px;
  padding: 14px;
}

.merge-mode-title {
  margin: 0 0 4px;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: #1e293b;
}

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

.single-option-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.merge-mode-option {
  display: grid;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #dbe3f3;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  font-weight: 400;
}

.merge-mode-option:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.merge-mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.merge-mode-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0b5fff;
}

.merge-mode-label {
  font-weight: 500;
  color: #0f172a;
  font-size: 14px;
}

.merge-mode-help {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
  font-weight: 400;
}

.primary-btn,
.secondary-btn,
.download-btn {
  font-family: "Montserrat", sans-serif;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
  font-size: 17px;
}

.secondary-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #ffffff;
  font-size: 17px;
}

.primary-btn:hover:not(:disabled),
.secondary-btn:hover:not(:disabled),
.download-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
  filter: saturate(1.03);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.download-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.pdf-action-row,
.excel-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pdf-action-row .primary-btn,
.pdf-action-row .secondary-btn,
.excel-action-row .primary-btn,
.excel-action-row .secondary-btn {
  margin-top: 0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  margin-top: 14px;
  font-weight: 600;
  color: #0f766e;
}

.progress-wrap {
  margin-top: 12px;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: #0b5fff;
  transition: width 0.2s;
}

.hidden {
  display: none;
}

.panel-results {
  padding-inline: 0;
  padding-bottom: 0;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.image-card {
  background: #ffffff;
  padding: 12px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.image-card img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.image-card p {
  font-weight: 600;
  margin: 10px 0;
  word-break: break-word;
}

.preview-hint {
  margin: 0 0 12px;
  color: #475569;
  font-size: 14px;
}

.download-btn {
  width: 100%;
  background: #16a34a;
  color: #ffffff;
}

.jpg-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.jpg-preview-card {
  padding: 8px;
  border-radius: 12px;
  cursor: default;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1px solid transparent;
}

.jpg-preview-card p {
  margin: 8px 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.remove-img-btn {
  width: 26px;
  height: 26px;
  margin: 2px auto 0;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.remove-img-btn svg,
.remove-file-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}

.queue-actions {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.reorder-btn {
  border: 1px solid #dbe3f3;
  background: #ffffff;
  color: #334155;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.reorder-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.file-item {
  background: #ffffff;
  border: 1px solid #dbe3f3;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  font-weight: 400;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-file-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  border-radius: 999px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 18px 0 34px;
}

.steps div {
  background: #ffffff;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.contact-form {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid #dbe3f3;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: "Open Sans", sans-serif;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.form-actions {
  margin-top: 14px;
}

.form-status {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 500;
}

.form-status.success {
  color: #0f766e;
}

.form-status.error {
  color: #dc2626;
}

.note {
  margin-top: 10px;
  font-size: 13px;
  color: #64748b;
}

@media (max-width: 720px) {
  .settings,
  .steps,
  .merge-mode-grid,
  .pdf-action-row,
  .excel-action-row,
  .file-list {
    grid-template-columns: 1fr;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }
}
