:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #d9e1ea;
  --text: #071936;
  --muted: #627089;
  --accent: #008b8f;
  --accent-strong: #00777b;
  --shadow: 0 18px 50px rgba(7, 25, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 0 70px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header {
  justify-content: space-between;
  gap: 18px;
}

.site-footer {
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: linear-gradient(180deg, #00a8a2, #00777b);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.language-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fbfc;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.language-option:hover {
  border-color: #b8dadd;
  color: var(--accent);
  transform: translateY(-1px);
}

.language-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.page-shell {
  flex: 1 0 auto;
  position: relative;
  min-height: calc(100vh - 140px);
  padding: 22px 224px 26px;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-contact-link:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.footer-contact-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.footer-analytics {
  width: fit-content;
  min-width: 0;
  max-width: none;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: left;
}

.footer-analytics-list {
  display: grid;
  gap: 6px;
  margin: 0;
  justify-items: start;
}

.footer-analytics-row {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  width: fit-content;
}

.footer-analytics-label {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  text-align: left;
}

.footer-analytics-label-alt {
  color: var(--muted);
  font-weight: 500;
}

.footer-analytics-value {
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
  text-align: right;
}

.feature-counter {
  align-self: center;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.how-it-works {
  max-width: 656px;
  margin: 21px auto 19px;
  text-align: center;
}

.how-it-works h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 27px;
  color: var(--muted);
}

.step {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.step:not(:last-child)::after {
  content: "---->";
  position: absolute;
  left: calc(100% + 10px);
  color: #8b97a8;
  font-size: 12px;
  letter-spacing: -1px;
}

.step-icon {
  display: block;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
}

.tool-card {
  width: 100%;
  max-width: 752px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--border);
}

.tool-tabs button {
  padding: 11px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tool-tabs button.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tool-panel {
  display: none;
}

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

.tool-body {
  padding: 18px;
}

.tool-body.has-sidebar {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 18px;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 22px;
}

.tool-menu {
  display: grid;
  align-content: start;
  border-right: 1px solid var(--border);
}

.tool-menu strong {
  margin-bottom: 10px;
}

.tool-menu a {
  padding: 10px;
  border-left: 3px solid transparent;
  color: var(--muted);
}

.tool-menu a.is-active {
  color: var(--accent);
  background: #eefafa;
  border-left-color: var(--accent);
  font-weight: 700;
}

.tool-form {
  display: grid;
  gap: 11px;
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 134px;
  padding: 15px;
  border: 1.5px dashed #6ac9cc;
  border-radius: 8px;
  background: #fbfeff;
  cursor: pointer;
  text-align: center;
}

.upload-box input {
  display: none;
}

.upload-box strong {
  font-size: 14px;
}

.upload-box span {
  color: var(--muted);
}

.image-upload-preview {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin-bottom: 9px;
  padding: 8px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 249, 0.92));
  box-shadow: inset 0 0 0 1px rgba(106, 201, 204, 0.22);
}

.image-upload-preview[hidden] {
  display: none;
}

.image-upload-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 141px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 14px 28px rgba(7, 25, 54, 0.12);
}

.upload-wide {
  min-height: 74px;
}

.settings-stack {
  display: grid;
  align-content: start;
  gap: 11px;
}

label,
fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  border: 0;
  padding: 0;
  font-weight: 700;
}

small,
.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

label.is-disabled {
  opacity: 0.68;
}

input,
select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
}

.check-row input {
  width: auto;
  min-height: auto;
}

button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  background: linear-gradient(180deg, #00a8a2, var(--accent-strong));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  background: #c5ced8;
  color: #f8fafc;
  cursor: not-allowed;
}

.tool-form > button {
  justify-self: start;
  min-width: 115px;
}

.result-panel {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfeff;
}

.result-panel[hidden] {
  display: none;
}

.result-panel strong,
.result-panel span {
  display: block;
}

.result-panel span {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.result-panel.is-error {
  border-left-color: #c0392b;
  background: #fffafa;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
}

.result-stats div {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.result-stats dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.result-stats dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.download-button {
  display: inline-grid;
  place-items: center;
  width: auto;
  min-width: 96px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #00a8a2, var(--accent-strong));
  color: #fff;
  font-weight: 800;
}

.secondary-button {
  width: auto;
  min-width: 72px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.file-list {
  display: grid;
  gap: 8px;
}

.merge-form {
  gap: 9px;
}

.merge-file-input {
  display: none;
}

.merge-file-list {
  min-height: 113px;
}

.file-list-header span {
  margin-top: 3px;
}

.file-list-items {
  display: grid;
  gap: 4px;
}

.merge-empty-state {
  display: grid;
  place-items: center;
  min-height: 113px;
  padding: 13px;
  border: 1px dashed #c8d8e8;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(245, 251, 252, 0.88), rgba(255, 255, 255, 0.96));
  text-align: center;
}

.merge-empty-state strong {
  font-size: 11px;
}

.merge-empty-state span {
  margin-top: 4px;
  color: var(--muted);
}

.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  background: var(--surface);
}

.file-list-name {
  color: var(--muted);
  word-break: break-word;
}

.merge-file-item {
  border-color: #dce7f0;
  border-radius: 8px;
  padding: 6px 9px;
  box-shadow: 0 6px 18px rgba(7, 25, 54, 0.045);
}

.merge-file-meta {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.merge-file-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 8px;
  background: #eff9fa;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.merge-file-icon {
  width: 18px;
  height: 22px;
  flex: 0 0 18px;
  color: #ff4d4f;
}

.merge-file-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.merge-file-name {
  color: #152441;
  font-size: 10px;
  font-weight: 700;
}

.file-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.merge-file-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.file-action {
  min-width: auto;
  min-height: 24px;
  padding: 0 9px;
  font-size: 10px;
}

.merge-icon-button {
  display: inline-grid;
  place-items: center;
  width: 27px;
  min-width: 27px;
  height: 23px;
  min-height: 23px;
  padding: 0;
  border: 1px solid #d8e2ed;
  border-radius: 8px;
  background: #fff;
  color: #51627f;
  box-shadow: none;
}

.merge-icon-button svg {
  width: 11px;
  height: 11px;
}

.merge-icon-button:hover:not(:disabled) {
  border-color: #b9dbe0;
  color: var(--accent);
}

.merge-icon-button:disabled {
  background: #fafcfe;
  color: #b1bfd0;
}

@media (max-width: 1024px) {
  .site-header,
  .site-footer {
    padding: 0 24px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .page-shell {
    padding: 22px 24px 26px;
  }
}

.merge-dropzone {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 9px 11px;
  border: 1.5px dashed #83cfd3;
  border-radius: 10px;
  background: radial-gradient(circle at top, rgba(225, 247, 248, 0.78), rgba(255, 255, 255, 0.96) 72%);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.merge-dropzone:focus-visible {
  outline: 2px solid #7bcfd0;
  outline-offset: 3px;
}

.merge-dropzone.is-dragover {
  border-color: var(--accent);
  box-shadow: 0 14px 40px rgba(0, 139, 143, 0.14);
  transform: translateY(-1px);
}

.merge-dropzone strong {
  font-size: 11px;
  color: #10213d;
}

.merge-dropzone span,
.merge-dropzone small {
  color: var(--muted);
  font-size: 12px;
}

.merge-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 105px;
  min-height: 27px;
  padding: 0 14px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 139, 143, 0.16);
}

.merge-add-button svg {
  width: 10px;
  height: 10px;
}

.merge-output-field {
  gap: 5px;
}

.merge-output-input-wrap {
  position: relative;
  display: block;
}

.merge-output-field input {
  padding-right: 30px;
}

.merge-output-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  color: #53647f;
  pointer-events: none;
}

.merge-output-icon svg {
  width: 100%;
  height: 100%;
}

.merge-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(0, 119, 123, 0.22);
}

.merge-submit-button svg {
  width: 14px;
  height: 14px;
}

.merge-submit-button:disabled {
  box-shadow: none;
}

.file-action.is-danger {
  background: #fff3f2;
  color: #9f2d22;
}

.file-action.is-danger:disabled {
  color: #f8fafc;
}

.ad {
  display: none;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #c5ced8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.ad-side {
  position: absolute;
  top: 22px;
  width: 144px;
  height: 512px;
}

.ad-left {
  left: 54px;
}

.ad-right {
  right: 54px;
}

.ad-bottom {
  width: 100%;
  max-width: 752px;
  min-height: 59px;
  margin: 22px auto 0;
}

.text-link {
  display: inline-block;
  margin-top: 19px;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 1180px) {
  .page-shell {
    padding-inline: 19px;
  }

  .ad-side {
    display: none;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    padding: 16px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .language-switcher {
    width: 100%;
    justify-content: flex-end;
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
  }

  .hero h1 {
    font-size: 27px;
  }

  .two-columns,
  .tool-body.has-sidebar {
    grid-template-columns: 1fr;
  }

  .steps {
    flex-direction: column;
    gap: 11px;
  }

  .step:not(:last-child)::after {
    display: none;
  }

  .tool-menu {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 13px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .file-list-item {
    align-items: start;
    flex-direction: column;
  }

  .file-list-actions {
    justify-content: start;
  }

  .merge-file-actions {
    width: 100%;
  }

  .merge-icon-button {
    flex: 1 1 0;
  }

  .footer-analytics {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
  }
}
