.gedcom-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(86vh, 780px);
}

.gedcom-shell {
  position: relative;
  min-width: 0;
  padding: 31px 34px 28px;
}

.parchment-dialog .gedcom-shell form {
  padding: 0;
}

.gedcom-shell > h2 {
  margin-bottom: 15px;
}

.gedcom-tabs {
  display: flex;
  gap: 5px;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid rgba(96, 68, 31, 0.25);
  border-radius: 11px;
  background: rgba(111, 82, 39, 0.08);
}

.gedcom-tabs button {
  flex: 1;
  min-height: 38px;
  border-radius: 8px;
  color: #5f492b;
  background: transparent;
  font-weight: 700;
}

.gedcom-tabs button[aria-selected='true'] {
  color: #342719;
  background: rgba(255, 245, 218, 0.78);
  box-shadow: 0 2px 8px rgba(71, 48, 20, 0.14);
}

.gedcom-dialog [role='tabpanel'] > form > p:first-child,
#gedcom-file-step > p:first-child {
  color: #685437;
  line-height: 1.55;
}

.gedcom-file-field {
  display: grid;
  gap: 8px;
  margin-top: 17px;
  padding: 18px;
  border: 1px dashed rgba(96, 68, 31, 0.46);
  border-radius: 12px;
  background: rgba(255, 247, 224, 0.35);
}

.gedcom-file-field > span,
.gedcom-new-tree-name > span {
  color: #4d3a23;
  font-weight: 700;
}

.gedcom-file-field small,
.gedcom-new-tree-name small {
  color: #786345;
  font-weight: 400;
}

.gedcom-file-field input[type='file'] {
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(86, 62, 29, 0.3);
  border-radius: 8px;
  background: rgba(255, 251, 239, 0.7);
}

.gedcom-help {
  margin: 9px 0 0;
  color: #766044;
  font-size: 12px;
}

.gedcom-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.gedcom-preview-heading div {
  display: grid;
  min-width: 0;
}

.gedcom-preview-heading span {
  color: #7c6544;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gedcom-preview-heading strong {
  overflow: hidden;
  color: #3d2d1b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gedcom-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 15px;
}

.gedcom-counts div {
  padding: 11px;
  border: 1px solid rgba(93, 66, 30, 0.22);
  border-radius: 9px;
  background: rgba(255, 247, 222, 0.43);
  text-align: center;
}

.gedcom-counts dt {
  color: #746044;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gedcom-counts dd {
  margin: 2px 0 0;
  color: #3e2d19;
  font: 600 22px/1 var(--font-display);
}

.gedcom-messages {
  max-height: 146px;
  margin: 10px 0;
  padding: 11px 13px;
  overflow: auto;
  border: 1px solid;
  border-radius: 9px;
}

.gedcom-messages h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.gedcom-messages ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}

.gedcom-errors {
  border-color: rgba(139, 49, 35, 0.42);
  color: #742e23;
  background: rgba(166, 65, 48, 0.08);
}

.gedcom-warnings {
  border-color: rgba(145, 103, 35, 0.4);
  color: #6d511d;
  background: rgba(174, 126, 42, 0.09);
}

.gedcom-destination,
.gedcom-privacy {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.gedcom-destination legend,
.gedcom-privacy legend {
  margin-bottom: 7px;
  color: #4d3a23;
  font-weight: 700;
}

.gedcom-destination > label,
.gedcom-privacy > label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 66, 31, 0.24);
  border-radius: 9px;
  background: rgba(255, 248, 228, 0.3);
}

.gedcom-destination input[type='radio'],
.gedcom-privacy input[type='radio'] {
  margin-top: 3px;
  accent-color: #816029;
}

.gedcom-destination label > span,
.gedcom-privacy label > span {
  display: grid;
  gap: 2px;
  color: #47351f;
}

.gedcom-destination small,
.gedcom-privacy small {
  color: #756044;
  font-size: 11px;
  line-height: 1.35;
}

.gedcom-destination .gedcom-new-tree-name {
  display: grid;
  gap: 6px;
  padding-left: 34px;
}

.gedcom-new-tree-name input {
  width: 100%;
}

.gedcom-dialog .dialog-actions {
  margin-top: 18px;
}

@media (max-width: 650px) {
  .gedcom-dialog {
    width: calc(100vw - 18px);
    max-height: 92vh;
  }

  .gedcom-counts {
    grid-template-columns: repeat(2, 1fr);
  }

  .gedcom-shell {
    padding: 27px 20px 21px;
  }

  .gedcom-preview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 1180px) {
  #gedcom-button span {
    display: none;
  }
}
