/* Hidden logo/step badges must not leave the text in their narrow grid track. */
html body #coordPanel :is(.coord-tool-header,.coord-step-heading) {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px !important;
  min-width: 0;
}
html body #coordPanel .coord-tool-header > div:not(.coord-tool-logo) {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
}
html body #coordPanel .coord-step-heading > div {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
}
html body #coordPanel :is(.coord-tool-logo,.coord-step-number) { flex: 0 0 auto; }
html body #coordPanel .coord-tool-header h2 {
  width: auto !important;
  max-width: 100%;
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  writing-mode: horizontal-tb !important;
}
html body #coordPanel .coord-step-heading b {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}
html body #coordPanel .hka-upload-panel-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
html body #coordPanel :is(.coord-tool-header,.hka-upload-panel-actions) > button {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap !important;
}
html body #coordPanel :is(.coord-grid,.coord-format-switch) {
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 8px !important;
}
html body #coordPanel :is(.coord-field,.coord-dms-grid label) { min-width: 0; }
html body #coordPanel :is(.coord-grid,.coord-dms-grid) :is(input,select) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 520px) {
  html body #coordPanel .coord-tool-header h2 { font-size: 16px !important; }
  html body #coordPanel #coordinateInputSection { gap: 8px; }
  html body #coordPanel .coord-step-card { padding: 10px !important; }
  html body #coordPanel .coord-step-heading { padding: 8px 10px !important; margin-bottom: 8px; }
  html body #coordPanel .coord-dms-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 8px; }
}
