.docx-merge-shell,
.docx-merge-shell *,
.docx-merge-shell *::before,
.docx-merge-shell *::after {
  box-sizing: border-box;
}

.docx-merge-shell {
  display: grid;
  gap: 24px;
  overflow-x: clip;
}

.docx-merge-page .section-inner {
  max-width: min(var(--max), 100%);
}

.docx-merge-workbench {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
}

.docx-merge-panel,
.docx-merge-side-panel,
.docx-merge-warning-panel {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(23, 32, 31, 0.07);
}

.docx-merge-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
}

.docx-merge-side {
  align-content: start;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.docx-merge-side-panel,
.docx-merge-warning-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.docx-merge-heading,
.docx-merge-subhead {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.docx-merge-heading h2,
.docx-merge-side-panel h2,
.docx-merge-warning-panel h2,
.docx-merge-subhead h3,
.docx-merge-empty h3 {
  color: #17201f;
  line-height: 1.3;
  margin: 0;
}

.docx-merge-heading h2,
.docx-merge-side-panel h2,
.docx-merge-warning-panel h2 {
  font-size: 20px;
}

.docx-merge-subhead h3,
.docx-merge-empty h3 {
  font-size: 16px;
}

.docx-merge-heading p,
.docx-merge-side-panel p,
.docx-merge-subhead p,
.docx-merge-empty p,
.docx-merge-help,
.docx-merge-warning-panel li {
  color: #5f6c68;
  line-height: 1.6;
  margin: 0;
}

.docx-merge-chip {
  align-items: center;
  background: #e9f2ff;
  border: 1px solid rgba(43, 91, 143, 0.18);
  border-radius: 8px;
  color: #244f7f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.docx-merge-dropzone {
  background: #f8faf8;
  border: 2px dashed #aebbb5;
  border-radius: 8px;
  display: grid;
  min-height: 176px;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.docx-merge-dropzone.is-active {
  background: #eef7ff;
  border-color: #356995;
}

.docx-merge-file-input {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.docx-merge-drop-inner {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 176px;
  padding: 22px;
  text-align: center;
}

.docx-merge-drop-title {
  color: #17201f;
  font-size: 18px;
  font-weight: 850;
}

.docx-merge-order,
.docx-merge-options {
  display: grid;
  gap: 14px;
}

.docx-merge-options {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
}

.docx-merge-field,
.docx-merge-check {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.docx-merge-field span,
.docx-merge-check span {
  color: #263331;
  font-size: 13px;
  font-weight: 850;
}

.docx-merge-field input {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.18);
  border-radius: 8px;
  color: #17201f;
  font: inherit;
  min-height: 42px;
  min-width: 0;
  padding: 9px 12px;
  width: 100%;
}

.docx-merge-check {
  align-content: center;
  align-items: center;
  display: flex;
  gap: 10px;
}

.docx-merge-check input {
  accent-color: #244f7f;
  height: 18px;
  width: 18px;
}

.docx-merge-segments {
  border: 0;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.docx-merge-segment {
  cursor: pointer;
  display: inline-flex;
  min-height: 42px;
  min-width: 116px;
  position: relative;
}

.docx-merge-segment input {
  opacity: 0;
  position: absolute;
}

.docx-merge-segment span {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.16);
  border-radius: 8px;
  color: #17201f;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-width: 116px;
  padding: 9px 13px;
  width: 100%;
}

.docx-merge-segment input:checked + span {
  background: #17201f;
  border-color: #17201f;
  color: #ffffff;
}

.docx-merge-segment input:focus-visible + span,
.docx-merge-field input:focus-visible {
  outline: 2px solid #244f7f;
  outline-offset: 2px;
}

.docx-merge-actions,
.docx-merge-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.docx-merge-button,
.docx-merge-icon-button {
  align-items: center;
  background: #17201f;
  border: 1px solid #17201f;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.docx-merge-button.is-secondary,
.docx-merge-icon-button {
  background: #ffffff;
  color: #17201f;
}

.docx-merge-button.is-muted {
  background: #244f7f;
  border-color: #244f7f;
  color: #ffffff;
}

.docx-merge-button.is-small,
.docx-merge-icon-button {
  min-height: 34px;
  min-width: 34px;
  padding: 7px 10px;
}

.docx-merge-button:hover:not(:disabled),
.docx-merge-icon-button:hover:not(:disabled) {
  border-color: rgba(36, 79, 127, 0.45);
}

.docx-merge-button:focus-visible,
.docx-merge-icon-button:focus-visible {
  outline: 2px solid #244f7f;
  outline-offset: 2px;
}

.docx-merge-button:disabled,
.docx-merge-icon-button:disabled,
.docx-merge-field input:disabled,
.docx-merge-check input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.docx-merge-empty,
.docx-merge-alert {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.1);
  border-radius: 8px;
  padding: 15px;
}

.docx-merge-alert {
  background: #fff7e8;
  border-color: rgba(217, 144, 33, 0.35);
  color: #754b00;
  font-weight: 750;
}

.docx-merge-file-list {
  counter-reset: docx-order;
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.docx-merge-file-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.docx-merge-file-row[data-state="invalid"] {
  border-color: rgba(167, 55, 48, 0.38);
}

.docx-merge-file-main {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.docx-merge-file-position {
  align-items: center;
  background: #eef3f8;
  border-radius: 8px;
  color: #244f7f;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.docx-merge-file-name {
  color: #17201f;
  display: block;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.docx-merge-file-meta,
.docx-merge-file-error {
  color: #66736f;
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.docx-merge-file-error {
  color: #9b2418;
  font-weight: 750;
}

.docx-merge-state {
  background: #eef6f1;
  border-radius: 8px;
  color: #0f5f59;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 6px 9px;
}

.docx-merge-file-row[data-state="reading"] .docx-merge-state {
  background: #fff4d8;
  color: #7a4f00;
}

.docx-merge-file-row[data-state="invalid"] .docx-merge-state {
  background: #ffe3df;
  color: #9b2418;
}

.docx-merge-file-row[data-state="merged"] .docx-merge-state {
  background: #e9f2ff;
  color: #244f7f;
}

.docx-merge-progress {
  background: #eef3f8;
  border: 1px solid rgba(36, 79, 127, 0.14);
  border-radius: 8px;
  color: #263331;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.docx-merge-progress span {
  font-weight: 850;
}

.docx-merge-progress[data-state="error"] {
  background: #fff0ed;
  border-color: rgba(155, 36, 24, 0.28);
  color: #9b2418;
}

.docx-merge-warning-panel ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.docx-merge-sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .docx-merge-dropzone,
  .docx-merge-button,
  .docx-merge-icon-button {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 900px) {
  .docx-merge-workbench,
  .docx-merge-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .docx-merge-panel,
  .docx-merge-side-panel,
  .docx-merge-warning-panel {
    padding: 16px;
  }

  .docx-merge-heading,
  .docx-merge-subhead,
  .docx-merge-file-row,
  .docx-merge-progress {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .docx-merge-chip,
  .docx-merge-button,
  .docx-merge-segment {
    width: 100%;
  }

  .docx-merge-file-actions {
    justify-content: stretch;
  }

  .docx-merge-icon-button {
    flex: 1 1 44px;
  }
}
